Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: Exclamation mark does not work with set -e Date: Mon, 6 Apr 2020 10:49:42 -0400 Lines: 21 Approved: bug-bash@gnu.org Message-ID: References: <2f74-5e8b3d80-85-5823c700@26668721> <20200406144942.GN845@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1586184589 20783 209.51.188.17 (6 Apr 2020 14:49:49 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: "fb@florentbordignon.fr" Envelope-to: bug-bash@gnu.org Mail-Followup-To: "fb@florentbordignon.fr" , bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <2f74-5e8b3d80-85-5823c700@26668721> User-Agent: Mutt/1.10.1 (2018-07-13) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 139.137.100.1 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <20200406144942.GN845@eeg.ccf.org> X-Mailman-Original-References: <2f74-5e8b3d80-85-5823c700@26668721> Xref: csiph.com gnu.bash.bug:16102 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)