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


Groups > gnu.bash.bug > #16102

Re: Exclamation mark does not work with set -e

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: Exclamation mark does not work with set -e
Date 2020-04-06 10:49 -0400
Message-ID <mailman.254.1586184588.2644.bug-bash@gnu.org> (permalink)
References <2f74-5e8b3d80-85-5823c700@26668721> <20200406144942.GN845@eeg.ccf.org>

Show all headers | View raw


On Mon, Apr 06, 2020 at 04:33:15PM +0200, fb@florentbordignon.fr wrote:
> Hello,
> 
> The following assertion succeeds when it should not :
> set -e
> ! true
> echo Hello # prints Hello but should not

              -e      Exit  immediately  if a pipeline (which may consist of a
                      single simple command), a list, or  a  compound  command
                      (see SHELL GRAMMAR above), exits with a non-zero status.
                      The shell does not exit if the  command  that  fails  is
                      part  of  the command list immediately following a while
                      or until keyword, part of the test following the  if  or
                      elif  reserved  words, part of any command executed in a
                      && or || list except the command following the final  &&
                      or ||, any command in a pipeline but the last, or if the
                      command's return value is being inverted with !.

(snip)

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: Exclamation mark does not work with set -e Greg Wooledge <wooledg@eeg.ccf.org> - 2020-04-06 10:49 -0400

csiph-web