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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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: pastebin.com/fycLjxrx And is not converted, is split on that character due to word splitting performed on unquoted strings. – manatwork Oct 4 '13 at 11:41

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.