LinuxCommandLibrary

ifs

IFS (Internal Field Separator) is a special environment variable that defines the delimiter used for word splitting in Unix shells.

TLDR

View the current IFS value

$ echo "$IFS"
copy


Change the IFS value
$ IFS="[:]"
copy


Reset IFS to default
$ IFS=$' \t\n'
copy


Temporarily change the IFS value in a subshell
$ (IFS="[:]"; echo "[one:two:three]")
copy

Copied to clipboard