bug-bash
[Top][All Lists]
Advanced

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

Re: Case of set -e not being in effect in a subshell.


From: Bartłomiej Palmowski
Subject: Re: Case of set -e not being in effect in a subshell.
Date: Tue, 12 Jun 2018 14:37:27 +0100

After so many years of using bash I assumed that there is nothing special
to set -e that I wouldn't know so I didn't bother to look it up in the
docs, my bad. Thanks for the answers!

2018-06-11 16:09 GMT+01:00 Chet Ramey <chet.ramey@case.edu>:

> On 6/11/18 6:12 AM, Bartłomiej Palmowski wrote:
>
> >
> > The issue is:
> > $ cat bad
> > (
> >     set -e
> >     false
> >     echo "Shouldn't happen?"
> > ) && :
> > $ bash ./bad ; echo $?
> > Shouldn't happen?
> > 0
>
> `set -e' is ignored for any command of an OR list except the last, whether
> it is in effect before the command is executed or when enabled by the
> command itself.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>


reply via email to

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