Bug 169420
Summary: | Doing "exit" in function doesn't terminate script | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Johan Walles <johan.walles> |
Component: | bash | Assignee: | Tim Waugh <twaugh> |
Status: | CLOSED NOTABUG | QA Contact: | Ben Levenson <benl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 4.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-09-28 12:17:23 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Johan Walles
2005-09-28 06:27:01 UTC
You are in a sub-shell. The sub-shell exited. Neither the info documentation nor the man page says a word about command substitution being performed in a sub-shell. Are you sure about this? AFAIU functions are supposed to be executed in the same shell as the caller (which they are unless they are called with $()). Feel free to re-close this if you are certain, but please say something about where I can find this behaviour documented as well. Sure it does, in 'man bash': Command substitution, commands grouped with parentheses, and asyn- chronous commands are invoked in a subshell environment that is a duplicate of the shell environment, except that traps caught by the shell are reset to the values that the shell inherited from its parent at invocation. Thanks for the pointer! I was looking in the "Command Substitution" section and the "FUNCTIONS" section. My bad. |