How to get the running process’ parent process’ ID in Bash?

How to get the running process’ parent process’ ID in Bash?

In Bash, you can get the parent process’s pid from the variable PPID.

Note that in a (...) subshell, the $$ stores the subshell’s parent shell pid actually.

Leave a Reply

Your email address will not be published. Required fields are marked *