Re: PIPESTATUS differs from $? for compound command
From:
Chet Ramey
Subject:
Re: PIPESTATUS differs from $? for compound command
Date:
Thu, 12 Dec 2024 11:35:24 -0500
User-agent:
Mozilla Thunderbird
On 12/12/24 2:01 AM, Mike Jonkmans wrote:
Moreover, bash accepts e.g.:
! ! false
How can you parse that, without a pipeline being a command?
Note that this is not posix, though bash accepts it even with --posix.
I implemented it that way because the original proposal
https://www.austingroupbugs.net/view.php?id=267
allows it, and that's what I implemented. By the time it made it into a
published standard (from 2010, when it was introduced, to 2022, when it
was approved), the grammar in the proposal changed.
--
``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/