Created
September 15, 2015 18:30
-
-
Save JordanReiter/b4cbef6163d4f69fa0bd to your computer and use it in GitHub Desktop.
Simple script that beeps twice after successful completion of a command, and five times if it fails
This file contains hidden or 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
SUCCESS_BEEPS=2 | |
ERROR_BEEPS=5 | |
prog=$1 | |
shift | |
args=$@ | |
function countbeep() { | |
head -c $1 < /dev/zero | tr '\0' "\a" | |
} | |
if $prog $args; then | |
countbeep $SUCCESS_BEEPS | |
else | |
countbeep $ERROR_BEEPS | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment