To make your bash script handle filenames with blanks better just put the following in a line above your file handling code:
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