--one upon a time--
if you try to process a for loop on file name with spaces in them, you are going to have some problem.
By default, the shell splits the output of a command on spaces, tabs, and newlines. it's called IFS variable
--example--
we have list of file on foltest:
and than the script is:
--theory jowo--
the long long explanation is To figure out what to set file to, the shell has to take the output of find and interpret it somehow, otherwise file would just be the entire output of find.
The shell reads the IFS variable, which is which is set to
To tell it to only split the input on newlines, you need to do
IFS=$(echo -en "\n\b")
before your for ... find command.
That sets IFS to a single newline, so it only splits on newlines, and not spaces and tabs as well.
That is probably enough to get your script working, but if you're interested to handle some other corner cases properly, read on...
--implementasi--
now lets take the theory to the reality..., are you ready ????
this is the script we will got:
--note--
for good environment add default value of IFS to the some variable and than restore it back when the looping is done
comment please ... ConversionConversion EmoticonEmoticon