BASH Shell: For Loop File Names With Spaces

Posted on in Categories File system, Linux, UNIX last updated November 16, 2013

BASH for loop works nicely under UNIX / Linux / Windows and OS X while working on set of files. However, if you try to process a for loop on file name with spaces in them you are going to have some problem. For loop uses $IFS variable to determine what the field separators are. By default $IFS is set to the space character. There are multiple solutions to this problem.