[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PIPESTATUS differs from $? for compound command
From: |
Mike Jonkmans |
Subject: |
Re: PIPESTATUS differs from $? for compound command |
Date: |
Thu, 12 Dec 2024 08:01:31 +0100 |
On Wed, Dec 11, 2024 at 07:44:02PM -0500, Lawrence Velázquez wrote:
> On Wed, Dec 11, 2024, at 3:50 AM, Mike Jonkmans wrote:
> > Or worse: '! true | ! true' is a syntax error!?
> > Also errors in dash, but not in ksh.
> > Can a command - as part of a pipeline - not be a pipeline?
> Not directly, no.
> https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html#tag_19_10_02
Yes, the posix grammar doesn't allow it.
But it is not clear, from the bash documentation,
that a pipeline is not a command.
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.
And, as said, ksh allows the construct (! true | ! true).
It is not impossible, it just is not posix.
> > What bothers me (only slightly), is the documentation.
> Judging by this thread, some clarification would be worthwhile.
! false
--
Regards, Mike Jonkmans
- Re: PIPESTATUS differs from $? for compound command, (continued)
- Re: PIPESTATUS differs from $? for compound command, Ulrich Müller, 2024/12/10
- Re: PIPESTATUS differs from $? for compound command, microsuxxor, 2024/12/10
- Re: PIPESTATUS differs from $? for compound command, Mike Jonkmans, 2024/12/10
- Re: PIPESTATUS differs from $? for compound command, Phi Debian, 2024/12/10
- Re: PIPESTATUS differs from $? for compound command, Chet Ramey, 2024/12/10
- Re: PIPESTATUS differs from $? for compound command, Mike Jonkmans, 2024/12/11
- Re: PIPESTATUS differs from $? for compound command, Andreas Schwab, 2024/12/11
- Re: PIPESTATUS differs from $? for compound command, Lawrence Velázquez, 2024/12/11
- Re: PIPESTATUS differs from $? for compound command,
Mike Jonkmans <=
- Re: PIPESTATUS differs from $? for compound command, Lawrence Velázquez, 2024/12/12
- Re: PIPESTATUS differs from $? for compound command, Mike Jonkmans, 2024/12/12
- Re: PIPESTATUS differs from $? for compound command, microsuxxor, 2024/12/12
- Re: PIPESTATUS differs from $? for compound command, Chet Ramey, 2024/12/12
- Re: PIPESTATUS differs from $? for compound command, Greg Wooledge, 2024/12/10
- Re: PIPESTATUS differs from $? for compound command, Ulrich Müller, 2024/12/10
Re: PIPESTATUS differs from $? for compound command, Chet Ramey, 2024/12/10