What is $$ in Bash?
June 22, 2020bash

What is $$ in Bash?

Listen to this article
AI voice: Sadaltager • Click play to generate
0:00
--:--

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

Here is an example use case:

echo $$

This produces the following output:

darryl@Darryl-PC$ echo $$
8