bug-bash
[Top][All Lists]
Advanced

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

Re: errexit is not suspended in a pipeline


From: Chet Ramey
Subject: Re: errexit is not suspended in a pipeline
Date: Wed, 11 Jan 2023 09:44:32 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 1/10/23 9:36 PM, Quinn Grier wrote:
In the documentation for set -e, the Bash manual says that errexit is
suspended in all but the last command of a pipeline:

       The shell does not exit if the command that fails is part of
       [...] any command in a pipeline but the last

That's not what that says. It doesn't say that the command doesn't fail, or
that `set -e' isn't active; it says how it affects the exit status of the
pipeline. This means that a non-terminal pipeline element failing doesn't
determine whether or not the shell exits, since it doesn't affect the
pipeline's exit status.

I'm not sure why you included the `part of' in your quote, since it clearly
applies to the text following it: "part of the command list immediately
following as while or until keyword, part of the test following ..."

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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