title: Case statements evaluate to strings
body: <p>I've caught the functional programming bug, so naturally nothing is good enough for me anymore. ;)</p>
  
  <p>So, in bash one could write:</p>
  
  <pre><code>case $status in
    "foo") status="bar" ;;
    "baz") status="buh" ;;
     *) status=$status ;;
  esac
  </code></pre>
  
  <p>but I'm afraid of typos, so I'd <strong>prefer</strong> to write:</p>
  
  <pre><code>status=case $status in
    "foo") "bar" ;;
    "baz") "buh" ;;
    *) $status ;;
  esac
  </code></pre>
  
  <p>The second form is invalid since the case evaluates to the exit code of the last executed command, which is not at all what I'm looking for.</p>
  
  <p>Are there easy hacks to achieving what I <strong>am</strong> looking for?</p>