title: How to get the output of a shell function without forking a sub shell?
body: <p>I have the following functions.</p>
  
  <pre><code>hello () {
          echo "Hello"
  }
  func () {
          hello
          echo "world"
  }
  </code></pre>
  
  <p>If I don't want the output of the hello function to be printed but want to do something with it, I want to capture the output in some variable, Is the only possible way is to fork a subshell like below? Is it not an unnecessary creation of a new child process? Can this be optimized?</p>
  
  <pre><code>func () {
          local Var=$(hello)
          echo "${Var/e/E} world"
  }
  </code></pre>