Advanced Bash-Scripting Guide: Prev Chapter 9. Another Look at Variables Next Builtin variables: variables affecting bash script behavior $BASH The path to the Bash binary itself bash$ echo $BASH /bin/bash $BASH_ENV An environmental variable pointing to a Bash startup file to be read when a script is invoked $BASH_SUBSHELL A variable indicating the subshell level. This is a new addition to Bash, version 3 . See Example 21-1 for usage. $BASHPID Process ID of the current instance of Bash. This is not the same as the $$ variable, but it often gives the same result. bash4$ echo $$ 11015 bash4$ echo $BASHPID 11015 bash4$ ps ax | grep bash4 11015 pts/2 R 0:00 bash4 But ... #!/bin/bash4 echo "\$\$ outside of subshell = $$" # 9602 echo "\$BASH_SUBSHELL outside of subshell = $BASH_SUBSHELL" # 0 echo "\$BASHPID outside...