Skip to content

Make exit_non_zero actually exit - #37

Merged
JonJagger merged 1 commit into
mainfrom
fix-exit-non-zero
Aug 9, 2026
Merged

JonJagger merged 1 commit into
mainfrom
fix-exit-non-zero

Conversation

@JonJagger

Copy link
Copy Markdown
Member

kill -INT $$ only stops the script while nothing traps INT. Add
a cleanup trap on INT - a normal thing for a script to do - and
bash runs the handler and resumes at the next statement, so a
guard prints its error and the script carries on to exit 0.
exit 42 cannot be declined, and the EXIT trap still cleans up.

  kill -INT $$ only stops the script while nothing traps INT. Add
  a cleanup trap on INT - a normal thing for a script to do - and
  bash runs the handler and resumes at the next statement, so a
  guard prints its error and the script carries on to exit 0.
  exit 42 cannot be declined, and the EXIT trap still cleans up.
@JonJagger
JonJagger merged commit a90092b into main Aug 9, 2026
3 checks passed
@JonJagger
JonJagger deleted the fix-exit-non-zero branch August 9, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant