|
From: | Ed Morton |
Subject: | Re: no exit status available when a command doesn't exist or fails in pipe to grep |
Date: | Thu, 9 Sep 2021 09:27:49 -0500 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 9/9/2021 8:08 AM, arnold@skeeve.com wrote:
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?"Andrew J. Schorr" <aschorr@telemetry-investments.com> wrote:So gawk forces the return code to 0 in POSIX mode in almost all cases.Ah, so it does. It's too much hair to distinguish "child exited with problem" from "could not close pipe and/or recover child info and/or whatever other mechanics went wrong". So I just punted. 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(). Arnold
Ed.
[Prev in Thread] | Current Thread | [Next in Thread] |