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

Path csiph.com!tncsrv06.tnetconsulting.net!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: set -e ignored in subshell if part of command list
Date Wed, 13 Nov 2019 11:53:57 -0500
Lines 80
Approved bug-bash@gnu.org
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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9qZVgc8K1doNoq2nZoVZX0oPzBfjIGq67"
X-Trace usenet.stanford.edu 1573664062 2811 209.51.188.17 (13 Nov 2019 16:54:22 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1573664045; bh=QelosS4Kph92B8WIbk3s/J+Drqjy8Ql8q56CDhVDyhI=; h=Subject:To:References:From:Date:In-Reply-To; b=yI1syAVn7bnD41RccE99gUpQ3T6YaRZbsK4d6ZRofgIelXC2TtjVGEF4vqMtz2vpn yyDZCbGe01e7ucnv9yqS1Wia0A6TaCf3Vli8UBuwBDvPMM3dSw74IpYcD310LNlQ7R kq8OR37/ZcraVYCH8OjW18VbPy2lGykNlb/S5Rg9elLa/YEm0FrqtJv/TjfCvq7cQY DggMkUN81cfR6EJiZ3pDIT7HHEaSO6RSAAVCS824YNWMFh4clttz9TnA1jT2JpxL8U 6mj6Ctk4rQXYLNEeE2RQ0V4l1rFSJtEvIERD8ZYYz+G//uK5rYO7QRgBKCxAa8S24O d0GNJoxDND3LbnfC76tMtzBEOsRYxxk7zqKW9B6iKnNZ2SMOmqT+Rk+yo1Uu+MTwvd Nzl4KRbJ0SpSRm4HNFTFb6pF7Kk4zaWmHTUMJPNF7ZgJVI7oZjbDFnTdZm9WKSc1Ao DC+ArYlZqBE9XslvrJ4UGnXVJ3ilui02J8axpvnQ854cOMaVBu+YxhcgH1sZ0OqvYY Y3s0OTHj8nDnDlh+zmHsoJNY2aISpqhWNpwP7aztearPV5NuCIoBg7RgFK7ORk7sdv zKWUqPVEuLARYsmGEZ45kTOuHo0bV5VQS6PnNd+alM6EcrkmgrNHw2Mn5H3ZjsVbkn 27gt6xBreVw3uBE4oAd+fCYs=
X-Clacks-Overhead GNU Terry Pratchett
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2
In-Reply-To <CAMhR0U3yqJ5N-gMCOK7SspOJcdcOCEtu_+cV3=zUgr7fJmkRRQ@mail.gmail.com>
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 88.198.91.70
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <2090944b-674f-6be3-f8a4-ad0d49ec44ed@archlinux.org>
X-Mailman-Original-References <CAMhR0U1fzAvXMVZacEYf9yAPwgq_6Gz5C-99dj6xt=9pQMtX8Q@mail.gmail.com> <13040a55-507d-e072-e827-be7c33be968f@case.edu> <CAMhR0U3yqJ5N-gMCOK7SspOJcdcOCEtu_+cV3=zUgr7fJmkRRQ@mail.gmail.com>
Xref csiph.com gnu.bash.bug:15676

Show key headers only | 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