1 # Unmodified nawk prints the 16 bit exit status divided by 256, but
2 # does so using floating point arithmetic, yielding strange results.
4 # The fix is to use the various macros defined for wait(2) and to
5 # use the signal number + 256 for death by signal, or signal number + 512
6 # for death by signal with core dump.
9 status = system("exit 42")
10 print "normal status", status
12 status = system("kill -HUP $$")
13 print "death by signal status", status
15 status = system("kill -ABRT $$")
16 print "death by signal with core dump status", status