title: Redirecting command output to a variable in bash fails
body: <p>I'm trying to redirect command output to a variable:</p>
  
  <pre><code>OUTPUT=$(sudo apache2ctl configtest)
  </code></pre>
  
  <p>and then to read it:</p>
  
  <pre><code>echo $OUTPUT
  </code></pre>
  
  <p>When running it the output is the following:</p>
  
  <pre><code>19:19:12 user@user ~ OUTPUT=$(sudo apache2ctl configtest)
  Syntax OK
  Syntax OK
  </code></pre>
  
  <p>But the variable stays blank. I've tried the same for other commands and everything works fine. </p>
  
  <pre><code>OUTPUT=$(ls -l)
  </code></pre>
  
  <p>This writes file list to variable <code>OUTPUT</code> so that it can be read later.
  What should i do to make it work?</p>