[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not to set PIPESTATUS unless necessary
From: |
Peng Yu |
Subject: |
Re: Not to set PIPESTATUS unless necessary |
Date: |
Sat, 18 May 2024 04:54:05 -0500 |
It seems the problem is the definition of pipeline is wrong. If there is
just one command, it can not be separated by control operators. Therefore,
a pipeline must be made of two or more commands.
“ A pipeline is a sequence of one or more commands separated by one of the
control operators ‘|’ or ‘|&’.”
The dictionary definition of pipeline is below. There must be transmission
of information in a pipeline. With just one command, there can not be a
pipeline.
https://www.merriam-webster.com/dictionary/pipeline
“ a direct channel for information”
Therefore, the current implementation appears to be a bug for following an
error in the manual.
On Sat, May 11, 2024 at 1:28 PM Chet Ramey <chet.ramey@case.edu> wrote:
> On 5/10/24 5:13 PM, Peng Yu wrote:
>
> >> I don't
> >> think an option to do this would be useful.
> >
> > I've already shown use cases where it may be useful. After all, it is
> > not necessary to diligently set PIPESTATUS duplicating the info in $?
> > for simple commands.
>
> I don't think it's generally useful enough to implement a special option
> in the shell itself to enable it. It's easy enough to save $PIPESTATUS
> if you want its value.
>
> --
> ``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/
>
> --
Regards,
Peng