Re: Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments

2013-08-29 Thread DJ Mills
On Thu, Aug 29, 2013 at 2:38 PM, Dan Douglas wrote: > On Thursday, August 29, 2013 01:03:20 PM DJ Mills wrote: > > $(arr=(foo bar baz); IFS=:; str=${arr[*]}; echo "$str") > > foo bar baz > > $ (arr=(foo bar baz); IFS=:; str="${arr[*]}"; echo "$str") > > foo:bar:baz > > > > Note that the same thin

Re: Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments

2013-08-29 Thread Dan Douglas
On Thursday, August 29, 2013 01:03:20 PM DJ Mills wrote: > $(arr=(foo bar baz); IFS=:; str=${arr[*]}; echo "$str") > foo bar baz > $ (arr=(foo bar baz); IFS=:; str="${arr[*]}"; echo "$str") > foo:bar:baz > > Note that the same thing does not occur for "$*": > $ (set -- foo bar baz; IFS=:; str=$*;

Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments

2013-08-29 Thread DJ Mills
$(arr=(foo bar baz); IFS=:; str=${arr[*]}; echo "$str") foo bar baz $ (arr=(foo bar baz); IFS=:; str="${arr[*]}"; echo "$str") foo:bar:baz Note that the same thing does not occur for "$*": $ (set -- foo bar baz; IFS=:; str=$*; echo "$str") foo:bar:baz $ (set -- foo bar baz; IFS=:; str="$*"; echo "