root/trunk/bin/waitpid @ 14940
1 |
#!/bin/sh
|
---|---|
2 |
# Waits for process(es), which don't need to be owned by the current shell.
|
3 |
# Usage: env [interval=...] self PID...
|
4 |
|
5 |
: "${interval=5}" # s |
6 |
|
7 |
for pid in "$@"; do |
8 |
while test -n "$(ps -p "$pid" -o pid=)"; do sleep "$interval"; done |
9 |
done
|