IFS

suggest change

Contains the Internal Field Separator string that Bash uses to split strings when looping, and so on. The default value is space, tab, and newline — the characters themselves, not the two-character strings \n and \t. Changing IFS lets you split strings on 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