I'm calling the sleep command from awk like so:
system("sleep 15m") and found that when I interrupt that with CTRL-C it only interrupts the sleep command, not the script. So I tried wrapping the system function in an if statement, as suggested in this sample script and further explained here. It then looks like
if (system("sleep 15m") != 0) exit 1.
That didn't work, so I tried
print system("sleep 3"), which always returns 0, contrary to the stated behavior. Typing
sleep 3 then
echo $? in the shell produces 0 if I let it run and 130 if I interrupt it.
So what am I missing? I've checked for typos several times, tried the --posix and --traditional switches, and studied the user's guide, nothing changes it.
$ awk --version GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0) Copyright (C) 1989, 1991-2015 Free Software Foundation.