Created
August 3, 2016 10:42
-
-
Save dolanor/cb2ed03fccc373882db51a7682511164 to your computer and use it in GitHub Desktop.
A wait script that will return the list of the return code for a list of pid that we want to wait on
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# to get pids, you can just do a | |
# myprocess & | |
# pids+="$! " | |
pids="$@" | |
rets="" | |
for i in $pids | |
do | |
wait $i | |
ret=$? | |
if [ $ret -ne 0 ] | |
then | |
echo "failed waiting for a service" | |
rets+="$ret " | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment