Thanks ntubski. I was going to something like this:
Code:
while [ ! -z "$(ps | grep program1)" ]; do
sleep 3
done
if [ ! $PRTN -eq 0 ]; then
echo "There was an error in program1"
exit 1
fi
Your solution seems a little nicer, so I'll give that a try. Thanks.
Oh and how do the put your code in that code box in your reply?