title: How to combine multiple sed commands into one
body: <p>I have 4 different sed commands which I am running on a file. And in order to tune in the performance of these 4 commands, I want to combine them into one.
  Each command is a complex command with -E switch. Searched many many forums but could not get my specific answer.</p>
  
  <pre><code>sed -i -E ':a; s/('"$search_str"'X*)[^X&amp;]/\1X/; ta' "$newfile"
  sed -i -E '/[&lt;]ExtData[&gt;?" "]/{:a; /Name=/{/Name="'"$nvp_list_ORed"'"/!b}; /Value=/bb; n; ba; :b; s/(Value="X*)[^X"]/\1X/; tb; }' "$newfile"
  sed -i -E ':a; s/('"$search_str1"'X*)[^X\&lt;]/\1X/; ta' "$newfile"
  sed -i -E ':a; s/('"$search_str2"'X*)[^X\/]/\1X/; ta' "$newfile"
  </code></pre>
  
  <p>And i want to combine them say something like</p>
  
  <blockquote>
    <p>sed -i -E 'command1' -e 'command2' -e 'command3' -e 'command4'
    "$newfile"</p>
  </blockquote>
  
  <p>But it is not working. Because may be -E and -e can't be combine.</p>
  
  <p>Please let me know.</p>
  
  <p>Thanks !! Puneet</p>