It's not obvious that if exitstatus is omitted, the exit status of the function is taken from the last executed command.
Details
Details
- Reviewers
jilles ziaee - Group Reviewers
docs manpages Contributor Reviews (src) - Commits
- rG931d4f0ae4f2: sh.1: Document the exit status of return
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Comment Actions
Let's not mention the behaviour when return exits the shell during an EXIT trap action, since it's obscure and probably incorrect (I think it's supposed to work like exit, with a difference between return by itself and return "$?", but in practice it always ignores the argument during an EXIT trap action).