[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] POSIX mode "system" returing invalid exit status
From: |
Steven Penny |
Subject: |
Re: [bug-gawk] POSIX mode "system" returing invalid exit status |
Date: |
Fri, 23 Mar 2018 06:39:27 -0500 |
On Fri, Mar 23, 2018 at 2:07 AM, arnold wrote:
> When gawk behaves differently with and without --posix, there is a reason.
Thanks for the reply. I checked here [1] and dont see any mention of "16-bit
value". No mention here [2] either. I do notice some strange results depending
on the compiler:
$ cat z.c
#include <stdio.h>
#include <stdlib.h>
int main() {
printf("%d\n", system("grep"));
}
$ x86_64-pc-cygwin-gcc -o cygwin z.c
$ x86_64-w64-mingw32-gcc -o mingw32 z.c
$ ./cygwin
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
512
$ ./mingw32
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.
2
[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
[2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/system.html