从c-shell脚本调用setsid,结果异常

时间:2018-07-04 14:18:01

标签: linux csh

我正在使用c shell使两个进程在同一进程组中运行。 我有两个脚本:

test.sh:

#!/bin/tcsh
echo "test\n"
setsid ./test_a.sh
exit

test_a.sh:

#!/bin/tcsh
echo "test_a\n"
sleep 1000s &
sleep 2000s &
exit

然后我运行./test.shps x -o "%p %r %c"。 我期望看到两个具有相同进程组ID的“休眠”进程,因为test_a是使用setsid执行的。但是,它们具有不同的进程组ID。我想念什么?

谢谢

0 个答案:

没有答案
相关问题