Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "$$" means in shell script? [duplicate]

Tags:

linux

bash

shell

I came across "$$" expression in shell script, something like this

TFILE=$$

Can anyone tell me its meaning?

like image 375
Vinit Dhatrak Avatar asked Dec 09 '09 22:12

Vinit Dhatrak


People also ask

What does $$ mean in shell script?

$$ is the pid (process id) of the shell interpreter running your script. It's different for each process running on a system at the moment, but over time the pid wraps around, and after you exit there will be another process with same pid eventually.As long as you're running, the pid is unique to you.

What is echo $$ in bash?

The echo command is used to display a line of text that is passed in as an argument. This is a bash command that is mostly used in shell scripts to output status to the screen or to a file.

What is the meaning of $$ in Linux?

$$ means the process ID of the currently-running process.

What is $$ variable in bash?

$$ 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 shell.


1 Answers

$$ means the process ID of the currently-running process.

like image 116
Ether Avatar answered Oct 23 '22 18:10

Ether