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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -