How can a Linux/Unix Bash script get its own PID? October 19, 2022 by Tarik The variable $$ contains the PID.