bug-gawk
[Top][All Lists]
Advanced

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

Re: no exit status available when a command doesn't exist or fails in pi


From: Neil R. Ormos
Subject: Re: no exit status available when a command doesn't exist or fails in pipe to grep
Date: Thu, 9 Sep 2021 10:15:45 -0500 (CDT)

Ed Morton wrote:
> arnold@skeeve.com wrote:
>> "Andrew J. Schorr" <aschorr@telemetry-investments.com> wrote:

>>> So gawk forces the return code to 0 in POSIX
>>> mode in almost all cases.

>> [...] And as I pointed out earlier, different
>> awks do different things anyway, so there's no
>> reliable portable way to deal with the status
>> from close().

> That's fine of course but why not just do in
> POSIX mode the same thing that gawk does in
> non-POSIX mode since it'd apparently still be
> POSIX compliant either way and would be more
> useful?

How would that be compliant with the POSIX
requirement that

| If the close was successful, the
| function shall return zero; otherwise,
| it shall return non-zero.

... ?

How does a return code from the command used with
the pipeline affect whether the close() was
successful?  Wouldn't close() be successful if it
has its usual effect?

Does a return code from the command prevent
close() from releasing any OS or gawk-internal
resources?

If, after the close(), something new is piped to
the identical command string (or whatever it's
called), does gawk treat the pipeline as it would
had close() not been called, or does it build a
new one and invoke the command(s) anew?



reply via email to

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