Sometimes we try to use a bash for loop to traverse a list of files, but if the filenames contain spaces, separating the name into two or more pieces, causing errors. To avoid it you define IFS variable characters should be used as delimiters, since by default also includes the newline and carriage return, space and tabulated.
An example of how employ:
# / bin / sh IFS =
$ '\\ x0A' $ '\\ x0D'
for file in $ (ls *)
do
/ usr / bin / $ file HAZALGO
Having done
here and here.
0 comments:
Post a Comment