johnslattery
3/30/2017 - 2:13 PM

Manage and understand IFS.

Manage and understand IFS.

# When $IFS is null (IFS=), no word splitting occurs.
# When $IFS is unset, the shell behaves as if $IFS is set to space, tab, new line.

# Reset IFS:
IFS=$' \t\n'
IFS="$(printf ' \t\n')"
IFS=<space> ctrl+v <tab> ctrl+v <enter>

# Temporarily change IFS:
IFS='|' command
# or store IFS in another variable and set IFS to that variable when done.