Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:55:59+00:00 2026-05-22T23:55:59+00:00

For testing purpose I am running several (few 100s ) expect scripts. All are

  • 0

For testing purpose I am running several (few 100s) expect scripts. All are spawned from the same parent (sometimes its pid is 1). Is there any way to kill them at one stretch without changing their source code and without killing the parent process itself ? Something like:

[root@devx-csb4 expect_scripts] kill -9 <child of pid=...>

All expect script are just the same but ran in a loop; see the following 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:56:00+00:00Added an answer on May 22, 2026 at 11:56 pm
    1. Give them all a name with a common substring and use pkill(1)

    2. Use ps, get the parent process ID, and kill all the PIDs attached to the parent process. This is undesirable when the parent process is 1. Notice that your notion of using kill -9 pid= suffers from the same problem — all the system daemon processes are children of PID 1.

    3. Keep a list of the expect script names; run ps and for each name in your list, find the PID; kill it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php server that is running my domain name. For testing purposes
For testing purposes I need my ABAP program to wait for few seconds. How
I need few Wordpress sites for testing purposes. It would be great if I
I'm running a client/server application locally on my Windows XP PC and for testing
How can I prevent Django, for testing purposes, from automatically fetching related tables not
For testing purpose, I need to create logs in a CSV file in my
For testing purpose I have a basic form with three inputs aligned on the
I am facing an error trying to configure omniauth for integration testing purpose with
For testing purposes I have to generate a file of a certain size (to
for testing purposes i need an recursive directory with some files, that comes to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.