From an answer to "Bash script doesn't see SIGHUP?", I've got the following in my script:
while true; do read; done
And, usually, this works fine. However, when run from (tl;dr) ... something else, read
exits with status code 1.
Why? And how can I deal with this and restore the desired behaviour (correctly triggering the EXIT
trap)?
(The "something else" is GNU make running Erlang's ct_run
, which uses erlexec
to run the script)
read
, and neither is the exit code checked... – ilkkachu Jun 20 '18 at 09:48cat
at the end of the script allows Ctrl+C, but doesn't run the trap. – Roger Lipscombe Jun 20 '18 at 10:04