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 c...@case.edu http://cnswww.cns.cwru.edu/~chet/