On 10/15/12 11:23 AM, Nikolai Kondrashov wrote:
> Hi everyone,
>
> I've noticed that errexit is disabled inside command substitution.
> Is this intentional?
Yes. It's been that way since bash-1.14. The reasons why are lost in
time -- it was 17 years ago, after all -- but probably go something like
not wanting the parent's settings to produce unexpected results in the
child process.
Current versions of bash disable -e inside command substitution only when
posix mode is not enabled.
> interesting, $SHELLOPTS shows it still on inside the command substitution.
Thanks, that's a problem.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/