title: Easiest way to get count val from mysql in bash
body: <p>Maybe i should use python or perl but i dont know any.</p>
  
  <p>I have 4 statements and i would like to check if there are any errors longer then an hour. My user is setup so i dont need to enter a mysql user/pass. This statement is in mysql_webapp_error_check.sh</p>
  
  <pre><code>#!/bin/bash
  mysql testdb -e "select count(*) from tbl where last_error_date &lt; DATE_SUB(NOW(), INTERVAL 1  HOUR);"
  </code></pre>
  
  <p>How do i make it give me the return value (count(*)) instead of printing to screen?</p>
  
  <p>Then i'll write an if statement and output to stdout/err for cron to use to email me (otherwise i want the script to be silent so nothing is emailed unless theres a problem)</p>