Skip to content

Instantly share code, notes, and snippets.

@JordanReiter
Created September 15, 2015 18:30
Show Gist options
  • Save JordanReiter/b4cbef6163d4f69fa0bd to your computer and use it in GitHub Desktop.
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
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