waitpid

#339
Raw
Author
winny
Created
March 8, 2021, 6:22 a.m.
Expires
Never
Size
134 bytes
Hits
270
Syntax
Bash
Private
No
#!/usr/bin/env bash

# Wait until a process exits.
#
# Usage: waitpid PID

set -eu
while [[ -d /proc/$1 ]]; do
    sleep 1
done