title: How can I assign the output of a function to a variable using bash?
body: <p>I have a bash function that produces some output:</p>
  
  <pre><code>function scan {
    echo "output"
  }
  </code></pre>
  
  <p><strong>How can I assign this output to a variable?</strong></p>
  
  <p>ie. VAR=scan (of course this doesn't work - it makes VAR equal the string "scan")</p>