title: Bash: Check output of command
body: <p>I need to check the output of <code>apachectl configtest</code> in a bash script and restart if everything looks good without outputting the command to the screen</p>
  
  <pre><code>var =sudo apachectl configtest
  </code></pre>
  
  <p>If var contains "Syntax OK" then</p>
  
  <pre><code>sudo apachectl graceful
  </code></pre>
  
  <p>How to do it?</p>