bash - why $BASH_SUBSHELL doesn't increase in pipe -
i know pipe create subshell.
i test $bash_subshell
, $bashpid
, , find $bash_subshell
doesn't increase in pipe
echo $bash_subshell # 0 echo $bashpid # 8347 echo $bash_subshell | cat # 0 echo $bashpid | cat # 9727 (echo $bash_subshell) # 1 (echo $bashpid) # 9778
when bash merely forks, sets command , execves it, doesn't count subshell.
for kind of control structure, command groups, if statements , while loops, shell has involved beyond setup, does.
this apparent bash source, execute_command_internal
in execute_cmd.c
.
Comments
Post a Comment