typeset | grep arrarr=x+b+c
> ==yash==
> $ typeset | grep arrtypeset arr='x+b+c'
> -- Mr. LE Manh CuongMobile: +84 1216 181090Skype: manhcuongle> Date: Fri, 13
> Mar 2015 23:15:43 +0100
>> Subject: IFS is ignored when concatenating array elements
>> From: izaber.
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
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
Here is the behaviour of other shells that allow that kind of syntax:
input: arr=(a b c); IFS=+; echo "${arr[*