title: insert line in HTML code job using shell
body: <p>Hi I have following sample HTML code:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
      &lt;HTML&gt;
         &lt;HEAD&gt;
           &lt;script src="../2.js"&gt;&lt;/script&gt;
         &lt;/HEAD&gt;
        &lt;body&gt;
          hello all!
        &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>I am trying to insert a <code>&lt;script&gt;</code> line in <code>&lt;HEAD&gt;</code> section.</p>
  
  <p>I tried following command:</p>
  
  <pre><code>sed  '/\&lt;HEAD\&gt;/a \&lt;script src="../blabla.js"\&gt;\&lt;/script\&gt;' input.html &gt; temp.html &amp;&amp; mv temp.html input.html
  </code></pre>
  
  <p>But this command is inserting the line twice, one is after <code>&lt;HEAD&gt;</code> and another after <code>&lt;/HEAD&gt;</code></p>
  
  <p>I want to insert only once. How I can overcome this?</p>