Skip to content

Fix default exit status of exit built-in in trap action #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

magicant
Copy link
Owner

This commit fixes the behavior of the exit built-in when used in a trap action without an operand. Previously, the shell would exit with the exit status of the last command executed in the trap action. This commit changes it to exit with the exit status of the last command executed before the trap action, as per POSIX specifications.

This commit fixes the behavior of the `exit` built-in when used in a
trap action without an operand. Previously, the shell would exit with
the exit status of the last command executed in the trap action. This
commit changes it to exit with the exit status of the last command
executed before the trap action, as per POSIX specifications.
@magicant magicant added the bug Something isn't working label Apr 23, 2025
@magicant magicant added this to the 2.59 milestone Apr 23, 2025
@magicant magicant self-assigned this Apr 23, 2025
@magicant magicant marked this pull request as ready for review April 24, 2025 13:39
@magicant magicant merged commit 9077c30 into trunk Apr 24, 2025
5 checks passed
@magicant magicant deleted the posix-exit-status branch April 24, 2025 13:40
@magicant magicant mentioned this pull request May 8, 2025
56 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant