Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14232 > unrolled thread

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

Started byBartłomiej Palmowski <rotwang@crux.org.pl>
First post2018-06-12 14:37 +0100
Last post2018-06-12 14:37 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Case of set -e not being in effect in a subshell. Bartłomiej Palmowski <rotwang@crux.org.pl> - 2018-06-12 14:37 +0100

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

FromBartłomiej Palmowski <rotwang@crux.org.pl>
Date2018-06-12 14:37 +0100
SubjectRe: Case of set -e not being in effect in a subshell.
Message-ID<mailman.1738.1528810652.1292.bug-bash@gnu.org>
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/
>

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web