Re: -i option of set missing in man bash

2015-03-13 Thread Chet Ramey
On 3/12/15 2:13 PM, Peng Yu wrote: >>> The -i option obviously works with set. But it is missing in the man >>> page. Should this be added? >> >> No. It's really only there for completeness, so things like `set $-' >> work as expected without error. > > But if something is in the implementation,

Re: -i option of set missing in man bash

2015-03-13 Thread Peng Yu
On Friday, March 13, 2015, Chet Ramey wrote: > On 3/12/15 2:13 PM, Peng Yu wrote: > >>> The -i option obviously works with set. But it is missing in the man > >>> page. Should this be added? > >> > >> No. It's really only there for completeness, so things like `set $-' > >> work as expected with

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[*

Re: -i option of set missing in man bash

2015-03-13 Thread Eduardo A . Bustamante López
> You can avoid these surprises by making -i just as other options, i.e., > working within the shell not just when a shell is started. [..] I don't think it's good to have set +/-i available after initialization. It's more complex to handle, and with little (or null?) gain. If you're using set -i i