The IFS
internal variable is used to determine what characters Bash defines as word/item boundaries when processing character strings. By default set to whitespace characters of space, tab, and newline.
Running the example ifs.sh
, comparing the difference between the default and setting only newline as a boundary we get the following output:
/path/to/first
file
/path/to/second
file
/path/to/third
file
/path/to/first file
/path/to/second file
/path/to/third file