What Does Echo $$ Do

Echo is a Unix/Linux command tool used for displaying lines of text or string which are passed as arguments on the command line. This is one of the basic command in linux and most commonly used in shell scripts.

What does echo $$ display?

The $$ variable holds the process ID of the script in which it appears. process id of the current shell from which $$ is executed.

What does $$ mean in Unix?

From Advanced Bash-Scripting Guide: $$ is the process ID (PID) of the script itself. $BASHPID is the process ID of the current instance of Bash. This is not the same as the $$ variable, but it often gives the same result.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest