bug-bash
[Top][All Lists]
Advanced

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

Re: errexit inconsistent behaviour with pipelines


From: Paul Jarc
Subject: Re: errexit inconsistent behaviour with pipelines
Date: Mon, 06 Oct 2008 14:52:18 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Marcin Owsiany <marcin@owsiany.pl> wrote:
> On Mon, Oct 06, 2008 at 09:22:30AM -0400, Chet Ramey wrote:
>> This bug only occurs when errexit is enabled and the final element of a
>> pipeline is a simple command that returns a non-zero exit status.
>
> Well, if the final element in the pipeline is a simple command, all
> works as is supposed to.

No.  It works the way you want it to, but not the way SUS says it
should.

> When it's a-not-so-simple command, like a for or while loop, then it
> does not terminate the parent.

That's the case that's behaving correctly, even though it's not the
way you want it to behave.  Neither case should terminate the shell.
Only a simple command should terminate the shell, and a pipeline is
not a simple command, even if its components are.  Chet is saying that
the next bash release will fix this bug - meaning that "true | false"
will no longer cause the shell to exit.


paul




reply via email to

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