root/bin/waitpid @ 6623
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=60}" # s |
6 |
|
7 |
for pid in "$@"; do |
8 |
while test -e "/proc/$pid"; do sleep "$interval"; done |
9 |
done
|