title: Replace one substring to another string in shell script
body: <pre><code>#!/bin/bash 
  filename=&quot;test.txt&quot;
  firstString=&quot;Suzi&quot; 
  secondString=&quot;I love Sara  &amp; Marry&quot;
   # do something...
  
  #The result must be like this:
  resultString=I love Sara  &amp; Marry
  </code></pre>
  <ul>
  <li><p>what to do if it contains &amp; in string and i am using this command
  but it replace &amp; with suzi like i love sara suzi marry</p>
  <p>sed -i &quot;s|${firstString}|${secondString}|g&quot; $filename</p>
  </li>
  </ul>
  <p>ng=&quot;I love Sara &amp; Marry&quot;</p>