root/bin/waitpid @ 10317
1 | 6209 | aaronmk | #!/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 | 7262 | aaronmk | : "${interval=5}" # s |
6 | 6209 | aaronmk | |
7 | for pid in "$@"; do |
||
8 | 7256 | aaronmk | while test -n "$(ps -p "$pid" -o pid=)"; do sleep "$interval"; done |
9 | 6209 | aaronmk | done
|