I am using osascript
in Bash to display a message in Notification Center (Mac OS X) via Apple Script. I am trying to pass a text variable from Bash to the script. For a variable without spaces, this works just fine, but not for one with spaces:
Defining
var1="Hello"
var2="Hello World"
and using
osascript -e 'display notification "'$var1'"'
works, but using
osascript -e 'display notification "'$var2'"'
yields
syntax error: Expected string but found end of script.
What do I need to change (I am new to this)? Thanks!
var2
contains literal"
characters. – Farris