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


Groups > gnu.bash.bug > #16337

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

From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: bash errexit shell option does not work in some cases.
Date 2020-06-01 09:16 -0400
Message-ID <mailman.897.1591017393.2541.bug-bash@gnu.org> (permalink)
References <5a7df0ba-3ad1-1f35-1107-09fdd5950359@archlinux.org> <3f403934d6b5d23ca58afc5146416c7@cweb006.nm.nfra.io> <1704.1591007300@jinx.noi.kre.to> <031b5b39-826a-6523-b03b-b839efe9eb63@archlinux.org>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 6/1/20 6:28 AM, Robert Elz wrote:
>     Date:        Sun, 31 May 2020 22:46:48 -0400
>     From:        Eli Schwartz <eschwartz@archlinux.org>
>     Message-ID:  <5a7df0ba-3ad1-1f35-1107-09fdd5950359@archlinux.org>
> 
> While I generally agree with ...
> 
>   | Don't use errexit
> 
> but not really with:
> 
>   | it does not mean what you think it does.
> 
> (it does mean what I think it means ...)

(I think shell developers are exempt from this generalization. :p)

> 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.
> 
> This all results from earlier posix specs where -e and simple commands
> were linked - the wording has been improved (still short of perfect)
> and simple commands are no longer relevant (other than that exit status
> generally originates with the result from a simple command).

As I am a poor user, I could not figure out whether the grammar allowed
or forbade this this result.

So this is actually that unbelievable of unbelievables, a script which
is broken because of set -e and it's actually because set -e has a bug?

Thanks for clarifying.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

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


Thread

Re: bash errexit shell option does not work in some cases. Eli Schwartz <eschwartz@archlinux.org> - 2020-06-01 09:16 -0400

csiph-web