title: Why 'pause -1' gnuplot command not working while executed in a while -r bash loop
body: <p>I'm trying to make a bash script in combination with gnuplot.
  I'm using an input file 'input.list' containing the single-column list of files to be analyzed with gnuplot.
  I'm using a following bash script:</p>
  
  <pre><code>    #!/bin/bash
          while read -r line
          do
  ...
  #Other operations on files
  ...
          gnupinp=$line
          gnuplot -e  "input='${gnupinp}'; plot input u 1:2; pause -1"
  
          done &lt; input.list
  </code></pre>
  
  <p>There are two issues probably connected:</p>
  
  <ol>
  <li><p>When first file from the list is analyzed the plot is created but the <code>pause -1</code> seems to be neglected while <code>pause 1</code> works fine.</p></li>
  <li><p>No matter if I use <code>pause -1</code> or <code>pause 1</code> the script fails starting from the <code>#Other operations on files</code> part when the second file from the list is executed.
  The same behavior can be obtained when I use <code>system 'sleep 1'</code> command in gnuplot.
  When I neglect <code>pause</code> command the gnuplot scripts are preformed properly for all listed files. </p></li>
  </ol>
  
  <p>thanks in advance for any help</p>