title: Shell script - math operations and loops
body: <p>I'm writing a sh file to run it via <code>cron</code> jobs, but I have no idea about shell script, I want to get the count of rows from <code>mysql</code> query then divide it by 200, <strong>ceil</strong> the result and start a loop from 0 to that amount.</p>
  
  <p>After a long search, I wrote this line to get the count of rows from <code>mysql</code> query, and this works fine.</p>
  
  <pre><code>total=`mysql database -uuser -ppassword -s -N -e "SELECT count(id) as total FROM users"`
  </code></pre>
  
  <p>but all what I get from Google doesn't help me to complete my work, I tested something like "expr" and "let" methods for math operations, but I don't know why not working.</p>
  
  <p>Even examples of loop I found on Google not working.</p>
  
  <p>Can you help me with this script?</p>