title: Replace strings in multiple files with corresponding caps using bash on MacOSX
body: <p>I have multiple .txt files, in which I want to replace the strings</p>
  
  <pre><code>old -&gt; new
  Old -&gt; New
  OLD -&gt; NEW
  </code></pre>
  
  <p>The first step is to only replace one string Old->New. Here is my current code, but it does not do the job (the files remain unchanged). The sed line works only if I replace the variables with the actual strings.</p>
  
  <pre><code>#!/bin/bash 
  old_string="Old"
  new_string="New"
  sed -i '.bak' 's/$old_string/$new_string/g' *.txt
  </code></pre>
  
  <p>Also, how do I convert a string to all upper-caps and all lower-caps?</p>
  
  <p>Thank you very much for your advice!</p>