【问题标题】:Command to display how many child processes the current interpreter has显示当前解释器有多少子进程的命令
【发布时间】:2018-06-10 18:41:31
【问题描述】:

我发现 echo $$ 显示当前解释器 PID。所以我想出了这个解决方案: ps -eo ppid | tail-n+2 | awk '{if($1==`echo $$`) print "bingo"}' | wc --lines

但是,它不起作用。我该如何解决这个问题?

【问题讨论】:

标签: linux unix awk terminal


【解决方案1】:

我想你正在寻找那个

ps -h --ppid $$ | echo $(($(wc -l) -2))

-2 去掉 ps 和 wc

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2013-09-08
  • 1970-01-01
  • 2011-09-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-03-19
相关资源
最近更新 更多