dollar dollar

The special parameter $$, which holds the process ID of the current shell.

In more detail

Scripts use it to signal themselves, as in kill -TERM $$, or to ask ps about the running shell. Inside a subshell it still reports the parent shell, which surprises people.

Example

ps -p $$ -o comm=

Related terms

Taught in

References