I am having a problem reconciling all of the field expansions rules in linux/unix, so I've been experimenting. Here is an example which based on my reading is not consistent with what I'd expect.
~$ IFS=$', \t\n'
~$ for i in 1 2 3; do echo num:"$i"; done
num:1
num:2
num:3
~$ myvar=1,2,3
~$ for i in $myvar; do echo num:"$i"; done
num:1
num:2
num:3
~$ for i in 1,2,3; do echo num:"$i"; done
num:1,2,3
The last output to me is completely unexpected. Where might I find the rule where field expansion only happens in a bash for loop for variables?
It seems to me that the bash for loop isn't honoring the IFS value that I setup at the beginning. Am I misunderstanding something?