What is $$ in Bash?

$$ is an internal variable, it stores the process ID of the script itself or the current bash instance.

Here is an example use case

echo $$

The output prompted.

darryl@Darryl-PC$ echo $$
8

 

By Darryl Dias

I am a 3D artist who spends this time creating renders and sequences that tell a story and at other times write code and Linux based development work

Leave a comment

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