title: osascript using bash variable with a space
body: <p>I am using <code>osascript</code> 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:</p>
  
  <p>Defining</p>
  
  <pre><code>var1="Hello"
  var2="Hello World"
  </code></pre>
  
  <p>and using</p>
  
  <pre><code>osascript -e 'display notification "'$var1'"'
  </code></pre>
  
  <p>works, but using</p>
  
  <pre><code>osascript -e 'display notification "'$var2'"'
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>syntax error: Expected string but found end of script.
  </code></pre>
  
  <p>What do I need to change (I am new to this)? Thanks!</p>