Bash $$ Variable: What Does It Mean? How Can You Use it? — Codefather

Bash has several internal variables and in this article we will look at the variable $$. What does this variable mean? How can you use it?

$$ is a Bash internal variable that contains the Process ID (PID) of the shell running your script. Sometimes the $$ variable gets confused with the variable $BASHPID that contains the PID of the current Bash