4 Matching Annotations
- Feb 2021
-
unix.stackexchange.com unix.stackexchange.com
-
sig_handler() { exit_status=$? # Eg 130 for SIGINT, 128 + (2 == SIGINT) echo "Doing signal-specific up" exit "$exit_status" }
-
-
-
stackoverflow.com stackoverflow.com
-
Remove your last "just in case" trap, and the script should work fine also with the EXIT traps. INT in the trap calling the cleanup should be the correct way to deal with the interrupts, however
-
-
unix.stackexchange.com unix.stackexchange.com
-
You need a trap in loop.sh. Traps are cleared for every subshell started unless they are explicitly trap ''SIG ignored by the parent.
-