title: Call to sed works from command line but fails in script
body: <p>I've been using the following call to <code>sed</code> to remove lines files.</p>
  
  <pre><code>sed "/% Program:/,/mode: SPIKE/d" file.tt &gt; file.tt.nh
  </code></pre>
  
  <p>I tried writing a bash script to allow me to run the script on many files at once. However <code>sed</code> fails.</p>
  
  <pre><code>sed "/% Program:/,/mode: SPIKE/d" file.tt &gt; file.tt.nh
  sed: -e expression #1, char 1: unknown command: `"'
  </code></pre>
  
  <p>This is the script I've written that isn't working</p>
  
  <pre><code>#!/bin/bash
  SEDARG='"/% Program:/,/mode: SPIKE/d"';
  for F in *.tt
  do
    OUT=$F'.nh';
    echo 'sed '$SEDARG' '$F' &gt; '$OUT;
    sed $SEDARG $F &gt; $OUT
  done
  </code></pre>
  
  <p>What perplexes me is if I copy the echo'd string and paste it in the command line it works fine. </p>
  
  <p>Does anyone know why this script is failing but the command line call works?</p>