bug-bash
[Top][All Lists]
Advanced

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

Re: bash errexit shell option does not work in some cases.


From: Greg Wooledge
Subject: Re: bash errexit shell option does not work in some cases.
Date: Mon, 8 Jun 2020 07:24:33 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon, Jun 01, 2020 at 05:28:20PM +0700, Robert Elz wrote:
> in this case:
> 
>   | You're merely the latest person to discover that this applies to you:
>   | http://mywiki.wooledge.org/BashFAQ/105
> 
> doesn't really apply - the cases reported are simply bugs in bash,
> a shell implementing -e correctly should exit as it was expected to.

The specification of set -e is not fixed.  It keeps changing.  Bash
implements a version of set -e that was specified at some point in
the past, which included the phrase "simple command".  So, the rules
that apply to compound commands and the rules that apply to simple
commands are not the same.

A more recent POSIX specification has changed the wording, and therefore
bash's implementation is out of date.  A future version of bash will
conform to the new wording, which means it will (once again) break
backward compatibility with older versions of bash (and also with any
other shells that still implement the older specification).

Simply waving this off as a "bug in bash" is quite unfair.

This is part of the set -e nightmare, which is what we keep trying to
get you (and everyone else) to understand.



reply via email to

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