[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -i option of set missing in man bash
From: |
Chet Ramey |
Subject: |
Re: -i option of set missing in man bash |
Date: |
Mon, 16 Mar 2015 15:47:31 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 |
On 3/13/15 8:47 PM, Eduardo A. Bustamante López wrote:
>> 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 inside a script, then you're clearly doing it the wrong way (whatever
> you're trying to achieve).
>
> *But* I do think it's misleading to have bash accept the 'i' flag, but not
> others. It also leads people to think that setting it from 'set' "worked",
> because it's in $- "if it has an 'i' in $-, then it *must* be interactive,
> right?", wrong.
Here's the other side: allowing `set -$-' to succeed keeps a Posix-mode
shell running a script from throwing a fatal error. Allowing it also
keeps the bug reports down. The same rationale can be used to add -c and
-s to the no-op flags, since those are command-line options that end up
in $-.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- -i option of set missing in man bash, Peng Yu, 2015/03/11
- Re: -i option of set missing in man bash, Chet Ramey, 2015/03/12
- Re: -i option of set missing in man bash, Peng Yu, 2015/03/12
- Re: -i option of set missing in man bash, Chet Ramey, 2015/03/13
- Re: -i option of set missing in man bash, Peng Yu, 2015/03/13
- Re: -i option of set missing in man bash, Eduardo A . Bustamante López, 2015/03/14
- Re: -i option of set missing in man bash,
Chet Ramey <=
- Re: -i option of set missing in man bash, Eduardo A . Bustamante López, 2015/03/16
- Re: -i option of set missing in man bash, Chet Ramey, 2015/03/20