The script I'm writing launches process A, which after an uncertain amount of time, launches a child process B.

I need the script to execute a command C which depends on process B. But B might not be there at call time!

How to wait until a process with a certain given name is spawned?

I reckon I could just blindly poll/wait inside an infinite loop but maybe there's a fancier solution...


Does C run parallel to B, or after B? (series?)

If parallel, why not have B start C at same time (via a script?)

If series, then modify script A to add C after B.

  • Clever approach, I didn't think of wrapping commands -potentially not user-modificable, e.g. firefox- in scripts. – vemv Jul 6 '12 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.