help-bash
[Top][All Lists]
Advanced

[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: Sun, 19 May 2024 15:29:06 -0500

On Sat, May 18, 2024 at 10:36 PM Koichi Murase <myoga.murase@gmail.com>
wrote:

> 2024年5月19日(日) 12:18 Peng Yu <pengyu.ut@gmail.com>:
> > On Sat, May 18, 2024 at 6:19 PM Koichi Murase <myoga.murase@gmail.com>
> wrote:
> >> 2024年5月18日(土) 22:57 Peng Yu <pengyu.ut@gmail.com>:
> >> > On Sat, May 18, 2024 at 5:21 AM Andreas Kähäri <andreas.kahari@abc.se>
> wrote:
> >> > > You would also need to take the POSIX standard's definiton of a
> pipeline
> >> > > into account, which I belive would trumph any dictionary's
> definition
> >> > > when it comes to implementing a Unix shell:
> >> > >
> >> > >         A pipeline is a sequence of one or more commands separated
> by
> >> > >         the control operator '|'.   [1]
> >> > >
> >> > > This is more or less the same as what you found in the bash manual,
> >> > > except for the extension that bash provides with |&
> >> >
> >> > In that case, the POSIX is also defective.
> >>
> >> It's not a language defect. POSIX *intentionally* includes a single
> >> command in the category of the pipeline as is clear from the formal
> >> grammar provided by POSIX, which Andreas has also quoted.
> >>
> >> > It is an impossibility that
> >> > one command is separated by a control operator.
> >
> >
> > You have to analyze each case separately. You can not justify one error
> by say others do similar samethings as a convention, therefore it is not an
> error. The logic is not correct.
> >
> > The grammar of POSIX could stay as is except the name of “pipeline” is
> wrong.
> >
> > Based your logic, you could say transgender women is a woman. That is
> just wrong. Transgender women is not a woman, it is something different
> from man and woman. Calling transgender women as women, demanding the same
> rights as women can cause all sorts of problems.
>
> Yes, we need to analyze each case separately. The reason that I
> commented about the superficial language is because you seem to talk
> about the superficial language. What is your reasoning for judging it
> wrong to count a single command as a kind of pipeline? There are all
> sorts of problems in identifying transgender people as either women or
> men, which are not just a superficial language issue. But then, what
> are the actual problems with counting a single command as a kind of
> the pipeline? Please don't talk about the superficial meaning of
> ``pipeline'' as a language. What is the problem?


The incorrect use of “pipeline” leads to the alteration of PIPESTATUS when
there is no real pipeline. Just like BASH_REMATCH is only reset when there
is regex match. PIPESTATUS should only be reset when there is a real
pipeline of two or more commands. Otherwise, there is no point to waste the
time to reset it.

>
>
> > There is YouTube video on doublespeak.
>
> Clearly, the choice of the term `pipeline' doesn't have any particular
> intention that you imagine. It's defined that way because it's
> practically useful that way.
>
-- 
Regards,
Peng


reply via email to

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