IFS

suggest change

Contains 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:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents