Home‎ > ‎

For loops with spaces

posted Nov 15, 2011, 9:59 AM by Allen Gattis
If you've ever tried to use a shell script to loop over data that spaces in it, you rapidly find that you get a loop iteration that is space delimited, as opposed to return delimited.

You can change that though, by changing the 'internal field separator', or IFS variable. 

IFS=$(echo -en "\n\b")