bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: DJ Mills
Subject: Re: Lack of quotes causes IFS to be ignored for "${arr[*]}" during assignments
Date: Thu, 29 Aug 2013 15:34:45 -0400

On Thu, Aug 29, 2013 at 2:38 PM, Dan Douglas <address@hidden> 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 thing does not occur for "$*":
> > $ (set -- foo bar baz; IFS=:; str=$*; echo "$str")
> > foo:bar:baz
> > $ (set -- foo bar baz; IFS=:; str="$*"; echo "$str")
> > foo:bar:baz
> >
> > I would expect the behavior of the two to be identical.
> >
> > $ echo "$BASH_VERSION"
> > 4.2.45(2)-release
> >
> > It also occurs in 4.2.45(1)-release and 3.2.51(1)-release.
>
> This was this issue:
> http://gnu-bash.2382.n7.nabble.com/More-fun-with-IFS-td11388.html
>
> The assignments are all consistent in 4.3.
>
> https://gist.github.com/ormaaj/6381747
> --
> Dan Douglas


Gotcha, thanks


reply via email to

[Prev in Thread] Current Thread [Next in Thread]