Waiting for a process to die

Chris Rees utisoft at googlemail.com
Sun May 31 19:43:19 UTC 2009

2009/5/31 Wojciech Puchar <wojtek at wojtek.tensor.gdynia.pl>:
>> How do I wait for a specific process to die? I want to do something like:
>> waitpid 1234&&(echo "done!" | Mail -s "PROC DONE"
>> kelly.terry.jones at gmail.com)
> if i understand you correctly:
> your_program parameters &
> bg_process_number=$!
> ...something else...
> wait $bg_process_number
> echo "done!"

Er, yeah, actually a much better idea than mine. Ignore my previous
suggestion :)


A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in a mailing list?

More information about the freebsd-questions mailing list