1

I have no experience writting sh/bash script for linux, I want to check if a process is running. If the process is running then wait, when the process is killed then execute another proccess, something like this (pseudo-code):

while main_process.run = True {
    do_nothing;
}
execute new_process

How can I do this in a small script.sh? Thanks!

MadAntrax
  • 510
  • 4
  • 10

1 Answers1

1

If your shell did start the process you are waiting for, then:

wait <process id>
execute_new_process
mauro
  • 5,730
  • 2
  • 26
  • 25