6 Matching Annotations
- Feb 2021
-
unix.stackexchange.com unix.stackexchange.com
-
unix.stackexchange.com unix.stackexchange.com
-
However, because so many shells follow that convention of having 128 + signal_number, programs know to avoid using those values above 128 for their exit code (or when they do exit(130), it's to report the death of a child that dies of a signal 2 like some shells do under some circumstances).
-
-
stackoverflow.com stackoverflow.com
-
Both kill with a job specifier and terminal signals send to the entire process group, so both the shell and sleep.
-
-
stackoverflow.com stackoverflow.com
-
I am trying to understand how CTRL+C terminates a child but not a parent process. I see this behavior in some script shells like bash where you can start some long-running process and then terminate it by entering CTRL-C and the control returns to the shell. Could you explain how does it work and in particular why isn't the parent (shell) process terminated? Does the shell have to do some special handling of CTRL+C event and if yes what exactly does it do?
-
-
unix.stackexchange.com unix.stackexchange.com
-
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
-