title: Why is Gnuplot's -e flag not working inside bash script in this case?
body: <p>I am running a bash script that, among other things, invokes Gnuplot.</p>
  
  <p>Suppose I have a file named <code>foo.dat</code>, containing some data points, like:</p>
  
  <pre><code>1.0 1.0
  2.0 2.0
  3.0 3.0
  </code></pre>
  
  <p>Now, if I run the following script:</p>
  
  <pre><code>#!/bin/bash
  file="foo.dat"
  echo gnuplot -e "\"plot '"$file"' using 1:2;pause -1\""
  gnuplot -e "\"plot '"$file"' using 1:2;pause -1\""
  </code></pre>
  
  <p>My shell outputs the following:</p>
  
  <pre><code>gnuplot -e "plot 'foo.dat' using 1:2;pause -1"
  
  "plot 'foo.dat' using 1:2;pause -1"
  ^
  line 0: invalid command
  </code></pre>
  
  <p>If I run <code>gnuplot -e "plot 'foo.dat' using 1:2;pause -1"</code> directly on the terminal emulator's command line, however, the output is the expected.</p>
  
  <p>What am I missing here?</p>