Re: IFS is ignored when concatenating array elements

2015-03-15 Thread isabella parakiss
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.

Re: IFS is ignored when concatenating array elements

2015-03-14 Thread Chet Ramey
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

IFS is ignored when concatenating array elements

2015-03-13 Thread isabella parakiss
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[*