IFS
suggest changeContains the Internal Field Separator string that bash uses to split strings when looping etc. The default is the white space characters: \n
(newline), \t
(tab) and space. Changing this to something else allows you to split strings using different characters:
IFS="," INPUTSTR="a,b,c,d" for field in ${INPUTSTR}; do echo $field done
The output of the above is:
a b c d
Notes:
- This is responsible for the phenomenon known as word splitting.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents