help-bash
[Top][All Lists]
Advanced

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

Re: Use of |&


From: alex xmb ratchev
Subject: Re: Use of |&
Date: Sat, 18 Feb 2023 13:19:33 +0100

On Sat, Feb 18, 2023, 8:44 AM goncholden <goncholden@protonmail.com> wrote:

>
> ------- Original Message -------
> On Tuesday, February 14th, 2023 at 4:19 AM, Dennis Williamson <
> dennistwilliamson@gmail.com> wrote:
>
>
> > On Mon, Feb 13, 2023 at 9:22 AM goncholden via help-bash@gnu.org wrote:
> >
> > > Have been using awk in a bash script.
> > >
> > > Have seen the use of "|&" rather than the usual "|". What is the reason
> > > for using
> > >
> > > "|&" exactly ?
> > >
> > > command |& getline info
> > >
> > > command | getline info
> >
> >
> >
> >
> > As Greg has said, in Bash |& is a pipe that passes both stdout and
> stderr.
> >
> > However, the examples you show are AWK syntax (specifically gawk,
> perhaps)
> > for the creation of a coprocess as Alex has said. In this case it has
> > nothing to do with Bash.
>
> Ok.  Thusly |& is a specific gawk command rather than a pipe invocation in
> bash.
>

good luck
the g/awk cmds n coproc deserve a fair warning , eg many used there may
need escaping , to be a valid unix cmd or sh line
to note about coproc , they share the env var values and changing them
inside reflects also on the other side

greets

>


reply via email to

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