In Bash the default string separator is whitespace which means spaces, tabs, or blank lines. The string separator is used in various places, including when looping with for over a string. The string separator is stored in the IFS variable.
If you want to set the default separator to “:” you need to do:
If you want to set is to newline, you can do it like this:
‘\x0a’ is the hexadecimal notation for newline or Ctrl-J.
A common pattern is to save the old separator before changing and restore it when you are done:
or more simple, just unset it when you are done: