|
From: | Aharon Robbins |
Subject: | Re: [bug-gawk] system() should return != 0 when the process is killed |
Date: | Mon, 07 Mar 2016 06:13:33 +0200 |
User-agent: | Heirloom mailx 12.5 6/20/10 |
> Gawk will keep on reading: > > $ seq 3 | gawk '{ print "<" $0 ">"; system("sleep 1") }' > <1> > ^C<2> > <3> Exactly as it should. > Same for nawk, mawk quits. > > $ seq 3 | mawk '{ print "<" $0 ">"; system("sleep 2") }' > <1> > ^C Bug in mawk. > Also worth noting, gawk exits with 0 in this case: > $ seq 3 | awk '{ print "<" $0 ">"; system("sleep 2") }' > <1> > ^C<2> > ^C<3> > ^C Also correct. The value from system should not affect gawk's exit code. I will address the original bug report later. I've been doing some trawling through the POSIX standard and I believe I know what a POSIX awk ought to do. Thanks, Arnold
[Prev in Thread] | Current Thread | [Next in Thread] |