IFS is a variable in Unix shells (Bourne, POSIX sh, bash, ksh, …) that controls how unescaped substitutions are split into words.
IFS
(short for "input field separator" and often referred to as "internal field separator") is a variable in Unix shells (sh, bourne-shell, ksh, bash, ash, dash, ksh, zsh, …) that controls how strings are split into multiple fields. Most notably, variable substitutions (e.g. $foo
) which are not inside double quotes or in a few other protected locations are split into multiple fields based on the value of IFS
; the same goes for command substitutions (e.g. $(foo)
). Each character that is present in IFS
is a field separator. The default value contains a space, a tab and a newline.
For other meanings of the acronym IFS, use the appropriate tag: