On 12/18/21 8:07 AM, yesxorno via Bug reports for the GNU Bourne Again
SHell wrote:
> When 'exit' is executed in a function called to "in-line" its output to
> stdout, the 'exit' acts like return, leaving the function scope, but
not > terminating the bash process.
I assume by "in-line" you mean command substitution.
The bash documentation says this about command substitution:
"Bash performs the expansion by executing command in a subshell environ-
ment and replacing the command substitution with the standard output of
the command, with any trailing newlines deleted."
The documentation describes a subshell environment more completely, but
the important piece is that the shell forks and creates a subshell. That
subshell is what the `exit' acts on.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/