[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command substitution and errexit

From: Chet Ramey
Subject: Re: Command substitution and errexit
Date: Mon, 15 Oct 2012 19:13:01 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:15.0) Gecko/20120907 Thunderbird/15.0.1

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.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]