10Jun/110
How to handle filenames containing whitespace in Bash
First capture the current IFS in $SAVEIFS and then replace it with a newline instead of spaces, now do your thing and afterwards restore the IFS with $SAVEIFS.
And yes, you can not use new lines in filenames
#!/usr/local/bin/bash SAVEIFS=$IFS IFS=$(echo -en "\n\b") for f in * do echo "$f" done IFS=$SAVEIFS




