[Gllug] Attach a command to run on completion of another process

- Tethys tethys at gmail.com
Wed Feb 28 14:35:42 UTC 2007


On 2/28/07, Tom Schutzer-Weissmann <trmsw at yahoo.co.uk> wrote:

> Is there a way to attach new commands to the outcome of one
> already running?

Not that I can think of. You can write a trivial shell loop to check
when the process dies and make a sound:

   while kill -0 $pid 2>/dev/null; do sleep 3; done; make_noise

That'll tell you when the process has finished, but it won't give you
its exit status. You'll have to manually check that, by looking at the
output of your make.

Tet
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list