I found in this in a on old
dump(8) I restored 2 days ago. What else has a man to do on the second day of Christmas?
I cannot recall why I wrote it, probably to show somebody on bsdforums.org who had a problem with this, at least for most beginning sh programmers, whitespace madness.
Indeed it has like both of you mentioned something to do with 'IFS' (inter field separator), a shell variable holding the characters, the shell uses to break up a string into words.
Code:
$ X='x y z'
$ echo "$X"
x y z
$ echo $X
x y z
$ IFS_ORIG=$IFS
$ IFS=''
$ echo $X
x y z
$ IFS=$IFS_ORIG
$ echo $X
x y z
As shown here, after setting IFS to nothing, the "echo $X" shows the original whitespace.