$PPID
–
Parent Process ID
$PPID
is read-only and contains the process id of the shell’s parent process.
The value remains the same even in subshells.
Links
BashSupport Pro is a Bash and POSIX IDE with support for $PPID – try it now!