title: Return value in a Bash function
body: <p>I am working with a bash script and I want to execute a function to print a return value:</p>
  
  <pre><code>function fun1(){
    return 34
  }
  function fun2(){
    local res=$(fun1)
    echo $res
  }
  </code></pre>
  
  <p>When I execute <code>fun2</code>, it does not print "34". Why is this the case?</p>