title: Easiest way to capitalize a string within bash 3.2?
body: <p>For example: <code>var=dog</code> and <code>echo $var</code> output is <strong>dog</strong>. <em>Capitalize <code>$var</code></em> expected output <strong>Dog</strong>.</p>
  
  <p>Tried multiple ways but just not getting the expected output. <em>Some attempts:</em></p>
  
  <pre><code>echo $var | sed "s/[a-z]\&amp;[:upper:]//"  #dog
  echo $var | sed "s/([a-z])/[:upper:]/"  #dog
  </code></pre>