1
我从另一个bash脚本(父母)中开始几个并行bash脚本(兄弟姐妹)。如何最好地在这些脚本中获取其他兄弟的PID?Bash - 获取兄弟姐妹的PID
父进程,我可以
ps -p $$ -o ppid --no-heading
得到,但我无法弄清楚如何得到它的子进程。
我从另一个bash脚本(父母)中开始几个并行bash脚本(兄弟姐妹)。如何最好地在这些脚本中获取其他兄弟的PID?Bash - 获取兄弟姐妹的PID
父进程,我可以
ps -p $$ -o ppid --no-heading
得到,但我无法弄清楚如何得到它的子进程。
完整性''pgrep -P'ps -p $$ -o ppid -no-heading''或''ps -ppid'ps -p $$ -o ppid --no-heading '-o“pid”--noheading''获得兄弟 –
或更好''pgrep -P $(ps -p $$ -o ppid -no-heading)'或'ps --ppid $(ps -p $$ -o ppid - 无标题)-o“pid”--noheading'来获取兄弟姐妹 –