Created
November 19, 2015 17:00
-
-
Save spion/b3d777af461c18a69cab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: ./timeout-alert.sh <time> "alert commands to execute" "main command to execute" | |
(sleep $1 && eval $2 ) & | |
ALERTPID=$! | |
eval $3 | |
kill $ALERTPID > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment