2011/7/25 Linda Walsh <b...@tlinx.org> > > > I know it wasn't designed this way, but it seems like it > is a bug. >
The manual says nothing about brace expansion using IFS in any way, so it's not a bug. If I do > read a b c <<<$(echo {1..3} ); echo "a:$a b:$b c:$c" > I get: > a:1 b:2 c:3 > > But If I do > export IFS=','; read a b c <<<$(echo {1..3} ); echo "a:$a b:$b c:$c" > I get: > a:1 2 3 b: c: > > Why should the 2nd case return the wrong answer? > I.e. shouldn't {1..3} use the IFS to separate arguments? > I don't see the usefulness in having brace expansion's behavior changed by IFS. If you want {1..3} to turn into the string "1;2;3", assign it to an array, then print the array that way array=( {1..3} ) (IFS=';'; echo "${array[*]}") # outputs "1;2;3" printf -v var '%s;' "${array[@]}"; echo "$var" # outputs "1;2;3;" -- Geir Hauge