Created
March 25, 2016 06:43
-
-
Save deostroll/88320f2fcb7a1228c2e9 to your computer and use it in GitHub Desktop.
script to wait for process in bash shell
This file contains hidden or 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
| pid=$1 | |
| echo "pid is $pid" | |
| check=1 | |
| while [ "$check" = "1" ] | |
| do | |
| val=$(ps | grep $pid | awk '{printf $1}') | |
| #echo "$val" | |
| if [ "$val" = "$pid" ]; then | |
| sleep 1 | |
| else | |
| check=0 | |
| fi | |
| done | |
| echo fin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment