Для тестирования я использую несколько (несколько 100s
) expect
скриптов.Все они порождены одним и тем же родителем (иногда его pid 1
).Есть ли способ убить их за один раз, не меняя их исходный код и , не убивая сам родительский процесс ?Что-то вроде:
[root@devx-csb4 expect_scripts] kill -9 <child of pid=...>
Все ожидаемые сценарии точно такие же, но запускаются в цикле;см. следующее ps -ef | grep milind
root 19879 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13265 55650
root 19889 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13266 55660
root 19899 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13267 55670
root 19930 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13268 55680
root 19940 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13269 55690
root 19973 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13270 55700
root 19983 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13271 55710
root 19993 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13272 55720
root 20024 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13273 55730
root 20034 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13274 55740
root 20067 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13275 55750
root 20104 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13276 55760
root 20114 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13277 55770
root 20145 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13278 55780
root 20155 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13279 55790
root 20188 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13280 55800
root 20198 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13281 55810
root 20208 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13282 55820
root 20239 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13283 55830
root 20249 1 0 20:27 pts/9 00:00:00 /usr/bin/expect /root/pjproject-1.0.3/pjsip-apps/bin/expect_scripts/milind.exp 13284 55840