Given the PID of the first process, the loop
while ps -p $PID; do sleep 1; done ; script2
should do the trick. This is a little more stable than pgrep and process names.
Given the PID of the first process, the loop
while ps -p $PID; do sleep 1; done ; script2
should do the trick. This is a little more stable than pgrep and process names.