Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Why is \ is converted to space on setting IFS='\'

echo $var # '(] {}$" 
share|improve this question
Has nothing to do with the “\”,that stands for any character: And is not converted, is split on that character due to word splitting performed on unquoted strings. – manatwork Oct 4 '13 at 11:41

1 Answer 1

Because, that's what IFS does. It is the Input Field Separator, bash will split unquoted strings on that character and you have set it to \:

$ var="fooAbar"
$ IFS='A'
$ echo $var
foo bar
$ echo "$var"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.