title: sed replace variables while read lines
body: <p>I'm working on a shell script and i need to change some strings from different lines of a file into a while read statement. The structure need to be like this, because the String_Search and String_result will be calculated on each line.</p>
  
  <pre><code>while read line 
  do  
     varA="String_Search"   
     resA="String_Result"
     line=`echo $line | sed -e "s/$varA/$resA"`
     echo $line &gt;&gt; outputFile.txt
  done &lt; "inputFile.txt"
  </code></pre>
  
  <p>The script doesn't works and its showing to me this error message:</p>
  
  <pre><code>sed: -e expression #1, char 31: unterminated `s' command
  </code></pre>
  
  <p>Anyone Can Help Me?</p>
  
  <p>Thanks to All</p>