[Top][All Lists]

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

Re: [PATCH v2] Ensure standard file descriptors are open on start

From: Nick Bowler
Subject: Re: [PATCH v2] Ensure standard file descriptors are open on start
Date: Fri, 28 Aug 2020 12:24:22 -0400

On 2020-08-28, Paul Eggert <> wrote:
> On 8/28/20 6:52 AM, Zack Weinberg wrote:
>> I think that for 2.70 we should make fd 0 read-only and 1,2
>> write-only here, and revisit this afterward -- when we're not in a
>> release freeze we can think about things like turning on set -e mode.
> Sounds good.
> In the longer term I doubt whether set -e is the way to go. I recall some
> old shells mishandling it (e.g., with 'set -e' the command 'A || B' would
> cause the shell to exit when A failed). And I suspect the use of 'set -e' to
> detect shell errors is problematic even today. 'set -e' is intended more as
> a debugging aid than as a programming facility.

Even if the shell implements POSIX requirements with no bugs, The semantics
for 'set -e' get so weird when complex commands are involved and that
weirdness propagates down into shell functions in very unintuitive ways.

Whether or not 'set -e' has any effect at all in a shell function body
depends on the specific shell syntax used at the point of the function

It certainly should not be enabled at the top level of configure scripts
by Autoconf (or any nontrivial shell script, really) as that will just
lead everyone to madness.


reply via email to

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