To make your bash script handle filenames with blanks better just put the following in a line above your file handling code:
IFS=$'n'
This tells bash to interprete only newlines as file seperators. Useful for grep, find, etc. as parameters of a for-loop. Obviously not very helpful if you have multiple file names in a line.
Found in the BSD-Team Dresden Wiki
anonymous
/ April 24, 2009Stefan.Marx@marx-consulting.COM writes:
Hi Raphael,thanks a very lot! Saved me a couple of 10 minutes of character replacement in my Java code.Quite elegant hack by the way ;=).Greetings from Cologne, Germany,cu Stefan
anonymous
/ March 15, 2011Anonym writes:perfect!used it with svn status (outputs status, a lot of blanks and then the filename)Danke schön!Greetings from KA