variable
Bash BASHPID — current Bash process ID
Expands to the process ID of the current Bash process. It can differ from $$ in a parenthesized subshell.
Formal Syntax & Structure
bash syntaxbash
$BASHPIDReturn Value
integer text
Current Bash process identifier.
Working Example
Example Snippetbash
printf 'outer: %s %s\n' "$$" "$BASHPID"( printf 'inner: %s %s\n' "$$" "$BASHPID" )