#!/bin/sh
# Waits for process(es), which don't need to be owned by the current shell.
# Usage: env [interval=...] self PID...
: "${interval=60}" # s
for pid in "$@"; do
while test -e "/proc/$pid"; do sleep "$interval"; done
done