bug-gawk
[Top][All Lists]
Advanced

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

Re: fflush & close behavior not well-defined


From: arnold
Subject: Re: fflush & close behavior not well-defined
Date: Thu, 01 Oct 2020 08:27:45 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Chet Ramey <chet.ramey@case.edu> wrote:

> On 10/1/20 10:10 AM, arnold@skeeve.com wrote:
> > I have no explanation. Maybe Chet does.
>
> I'm not familiar enough with the gawk semantics to understand which child
> processes are run by gawk directly and which are run by the shell. It's not
> clear exactly which writer process is getting the SIGPIPE.

The |& opens a two-way pipe to the child process. The child process is
always a shell running whatever command via sh -c.

> Does gawk read the output from `cat' or just send it straight to stdout?
> And does it wait for the pipeline to terminate before running the close?

If gawk's close() is called then it closes the pipe, period. In the example
code it wrote to the child but didn't read anything from it.

Thanks,

Arnold



reply via email to

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