title: Echo output to terminal within function in BASH
body: <p>I am writing a script in BASH. I have a function within the script that I want to provide progress feedback to the user. Only problem is that the echo command does not print to the terminal. Instead all echos are concatenated together and returned at the end.</p>
  
  <p>Considering the following simplified code how do I get the first echo to print in the users terminal and have the second echo as the return value?</p>
  
  <pre><code>function test_function {
      echo "Echo value to terminal"
      echo "return value"
  }
  
  return_val=$(test_function)
  </code></pre>