【问题标题】:what does `$$` represent in ps command? [duplicate]`$$` 在 ps 命令中代表什么? [复制]
【发布时间】:2012-05-29 00:29:20
【问题描述】:

可能重复:
What does $$ mean in the shell?

$ ./cruncher & ./cruncher & ./cruncher &
$ ps -C cruncher -p $$ -o pid,state,cmd
PID S CMD
2588 S bash
2657 R /bin/sh ./cruncher
2658 R /bin/sh ./cruncher
2659 R /bin/sh ./cruncher

-C cmdlist      Select by command name.
                       This selects the processes whose executable name is
                       given in cmdlist.

-p pidlist      Select by PID.
                       This selects the processes whose process ID numbers
                       appear in pidlist.

问题>$$是什么意思?

【问题讨论】:

标签: linux


【解决方案1】:

ps命令无关,$$被shell替换为其进程ID

【讨论】:

    【解决方案2】:

    它是一个内置的 shell 变量,其中包含 PID 进程 ID。

    【讨论】:

      猜你喜欢
      • 2015-05-24
      • 1970-01-01
      • 1970-01-01
      • 2011-10-30
      • 1970-01-01
      • 2013-05-06
      • 2014-07-30
      • 2014-02-04
      • 1970-01-01
      相关资源
      最近更新 更多