2

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...

deprecated
  • 2,841
  • 4
  • 24
  • 22

1 Answers1

3

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.

lornix
  • 3,452
  • 19
  • 29
  • Clever approach, I didn't think of wrapping commands -potentially not user-modificable, e.g. `firefox`- in scripts. – deprecated Jul 06 '12 at 12:35