Last active
August 29, 2015 14:04
-
-
Save cmittendorf/9d3c33023f4f2917f8ff to your computer and use it in GitHub Desktop.
A little snippet showing how to create a log function in bash that displays its log message in the Mac OS X notification center as well as on the console.
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
#!/usr/bin/env bash | |
function log() | |
{ | |
echo `date +"[%d.%m.%Y %H:%M:%S] "`$1 | |
# Available Sounds: | |
# Basso, Blow, Bottle, Frog, Funk, Glass, Hero, | |
# Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink | |
osascript << EOF | |
display notification "$1" with title "`basename $0`" sound name "Submarine" | |
EOF | |
return | |
} | |
log "$*" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment