title: sed to insert data in file after a pattern
body: <p>I have an xml file and trying to append a shell variable contents into the file using sed. The below command works fine but when I use it in a script, it gives me below error. Any suggestions please</p>
  
  <p>sed: -e expression #1, char 66: unknown command: `&lt;'</p>
  
  <pre><code>REQUEST="&lt;abc&gt;abc&lt;/abc&gt;\n&lt;xyz&gt;xyz&lt;/xyz&gt;"
  sed -i "/&lt;NAME&gt;/ i $REQUEST" file.xml
  
  file.xml:
  &lt;abc&gt;abc&lt;/abc&gt;
  &lt;xyz&gt;xyz&lt;/xyz&gt;
  &lt;NAME&gt;
  </code></pre>