On 3/14/15, Le Manh Cuong wrote:
> In bash, you need to quote in second arr assignment:
> $ arr=(a b c); IFS=+; arr="${arr[*]/a/x}"; echo "$arr"x+b+c
> A note that the result from those shells are different. After second
> assignment to arr:
> - In bash and ksh, arr still be an array, contain 3 el
On 3/13/15 6:15 PM, isabella parakiss wrote:
> This works as I would expect:
>
> $ arr=(a b c); IFS=+; echo "${arr[*]/a/x}"
> x+b+c
>
>
> But for some reason, this ignores IFS:
>
> $ arr=(a b c); IFS=+; arr=${arr[*]/a/x}; echo "$arr"
> x b c
Because it doesn't occur within a double-quoted stri