A slightly upgraded bash/zsh function for displaying a notification:
noti() {
osascript -e \
'on run argv
display notification (item 1 of argv) with title "Notification"
end run' \
$1
}
# Example:
noti 'Hello world!'
This fixes any escaping issues by passing the notification string to osascript as an argument instead of embedding it in the text of the program (which makes things like quotation marks not work correctly).
Sticking it in your .bashrc or .zshrc will make it available at any time in your shell.
Sticking it in your .bashrc or .zshrc will make it available at any time in your shell.