From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 Description of problem: The expansion of the list of a for statement does not work the same with IFS changed as it does with the default IFS. If the list consists of a variable containing a list of items separated by IFS, and this variable is followed by IFS and then another item, the last item in the variable's list is concatenated with the following item. This does not happen when IFS is blank space. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.Run the script provided below. 2. 3. Actual Results: foo bar baz next foo bar baz next Expected Results: foo bar baz next foo bar baz next Additional info: Here's the script that shows it #! /bin/sh TO_DO_LIST="foo bar baz" for item in $TO_DO_LIST next do echo $item done IFS=: TO_DO_LIST="foo:bar:baz" for item in $TO_DO_LIST:next do echo $item done
Upstream maintainer clarified the issue to me in private mail: only the result of the variable expansion is eligible for field splitting here. Use 'echo "$item"' to see more clearly what's going on; you get this output: bar baz next foo bar baz:next This is how POSIX specifies field splitting to operate.