Skip to content

Instantly share code, notes, and snippets.

@Rocketeer007
Created November 25, 2016 09:53
Show Gist options
  • Save Rocketeer007/6a261aeecdc3958638497da088b2d460 to your computer and use it in GitHub Desktop.
Save Rocketeer007/6a261aeecdc3958638497da088b2d460 to your computer and use it in GitHub Desktop.
Monitor a process and notify when it completes
#!/bin/sh
trap "" HUP
PID=$1
shift
MESSAGE=$*
while ps --pid ${PID} >/dev/null 2>&1; do
sleep 5
done
notify.sh ${MESSAGE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment