I want to stall the execution of my BASH script until a process is closed (I have the PID stored in a variable). I\'m thinking
while [PID IS RUNNING]; do sleep 5
ps --pid $pid &>/dev/null
returns 0 if it exists, 1 otherwise