PID of the Bash Process
$BASHPID
expands to the process ID of the current Bash process. Subshell processes have a different ID than the parent process.
This is similar to $$
, but not the same. $$
contains the process ID of the script, i.e. the parent process.
Links
Examples
Print PID of the current process :
|
|
Print PID of the current subshell process :
|
|
BashSupport Pro is a Bash IDE with support for $BASHPID – try it now!