title: Replacing text with sed containing whitespace in variable
body: <p>I try to replace some text within a text file. In my script I have store the text to find and to replace within two variables:</p>
  
  <pre><code>$currentProductName='hello'
  $configProductName='byebye'
  </code></pre>
  
  <p>The replacing is done with this line:</p>
  
  <pre><code>sed -i'.bak' 's/$currentProductName/$configProductName/g' "$projectFile"
  </code></pre>
  
  <p>Everything works fine until any of my variables are containing whitespaces. If the <code>$configProductName</code> is set to <code>hello world</code> the <code>sed</code>command does not work as expected.</p>
  
  <p>I´ve already tried this but it doesn't work, too:</p>
  
  <pre><code>sed -i'.bak' 's/"$currentProductName"/"$configProductName"/g' "$projectFile"
  sed -i'.bak' 's/\$currentProductName/\$configProductName/g' "$projectFile"
  </code></pre>
  
  <p>How do I must change the line to work as expected?</p>