Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 4
    "I get exit code 130" – Probably related to WCE (see e.g. this answer and links therein). I guess when Ctrl-C kills sleep and there is no trap for SIGINT in the shell, the shell kills itself with SIGINT at the very end because of WCE; in effect exit 0 does not matter. I'm not sure why we get In exit_trap $?=0 though. Waiting for a good answer. Commented Sep 28 at 21:14
  • In exit_trap $?=0 seems to be the exit status of the trap exit_trap EXIT command itself ... Shell seems to die after SIGINT leaving out some unfinished tasks like updating $? with the last status ... Send SIGQUIT instead with Ctrl+\\ and that should terminate differently ... Trapping SIGINT intercepts it so the shell terminates differently by exit 1 in your function and not because of SIGINT. Commented Sep 30 at 15:11