“$$”在shell脚本中的含义是什么? [重复]

时间:2021-12-23 16:55:14

This question already has an answer here:

这个问题在这里已有答案:

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

我在shell脚本中遇到了“$$”表达式,就像这样

TFILE=$$

TFILE = $$

Can anyone tell me its meaning?

谁能告诉我它的含义?

4 个解决方案

#1


20  

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

$$表示当前正在运行的进程的进程ID。

#2


5  

It's the process id of the current process - see a previous question on * for details: What does $$ mean in the shell?

它是当前进程的进程ID - 有关详细信息,请参阅*上的上一个问题:$$在shell中的含义是什么?

#3


1  

$$ is the process id of the currently running process in UNIX.

$$是UNIX中当前正在运行的进程的进程ID。

mostly it is used with naming of logfiles aor temp files, such that there is no conflict of file names while multiple instances of the same scripts are running.

主要用于命名日志文件或临时文件,以便在运行相同脚本的多个实例时不会发生文件名冲突。

#4


0  

echo "$$" prints PID of current running process.

echo“$$”打印当前运行进程的PID。

#1


20  

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

$$表示当前正在运行的进程的进程ID。

#2


5  

It's the process id of the current process - see a previous question on * for details: What does $$ mean in the shell?

它是当前进程的进程ID - 有关详细信息,请参阅*上的上一个问题:$$在shell中的含义是什么?

#3


1  

$$ is the process id of the currently running process in UNIX.

$$是UNIX中当前正在运行的进程的进程ID。

mostly it is used with naming of logfiles aor temp files, such that there is no conflict of file names while multiple instances of the same scripts are running.

主要用于命名日志文件或临时文件,以便在运行相同脚本的多个实例时不会发生文件名冲突。

#4


0  

echo "$$" prints PID of current running process.

echo“$$”打印当前运行进程的PID。