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


Groups > gnu.bash.bug > #15676

Re: set -e ignored in subshell if part of command list

From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: set -e ignored in subshell if part of command list
Date 2019-11-13 11:53 -0500
Message-ID <mailman.1356.1573664061.13325.bug-bash@gnu.org> (permalink)
References <CAMhR0U1fzAvXMVZacEYf9yAPwgq_6Gz5C-99dj6xt=9pQMtX8Q@mail.gmail.com> <13040a55-507d-e072-e827-be7c33be968f@case.edu> <CAMhR0U3yqJ5N-gMCOK7SspOJcdcOCEtu_+cV3=zUgr7fJmkRRQ@mail.gmail.com> <2090944b-674f-6be3-f8a4-ad0d49ec44ed@archlinux.org>

Show all headers | View raw


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

On 11/13/19 10:59 AM, Shaun Crampton wrote:
> But the commands in the subshell execute inside a different shell
> execution context so they shouldn't have
> their own set -e context (Section 2.12)?
> 
> I don't see where the spec says that the subshell has to inherit the
> and/or list-ness of the
> parent context.  Section 2.12 doesn't mention that as being one of the
> things that a subshell inherits
> (and unless I'm missing a good use-case, it seems like a pretty
> useless thing to inherit in a subshell
> or a function that happens to be called on the LHS of an and/or).
You're trying to defend the behavior you *want* set -e to have, even
though many people rely on set -e having the behavior it does, indeed,
have. Why do you require that yet another behavior change be made, so
that it is even harder to know what set -e will do across various
shells, and across various *versions* of a shell?

set -e already has more than enough exceptions to every single rule it
ever had. It's a collection of inchoate nonsensical lexical rules. Don't
use it, for all the reasons enumerated here:

https://mywiki.wooledge.org/BashFAQ/105

Everyone will be much happier if they just don't use set -e, and,
instead, implement actual real error handling that a) works, b) does
what they expect in their own special snowflake case.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

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


Thread

Re: set -e ignored in subshell if part of command list Eli Schwartz <eschwartz@archlinux.org> - 2019-11-13 11:53 -0500

csiph-web