title: boolean type for while loop in bash?
body: <p>I have a cron script on a shared web host that occasionally gets killed. I'd like to make a loop in bash that tries again if it gets killed, because most of the time it will make it. I'm having trouble with the syntax for storing a boolean value :P</p>
  
  <pre><code>#!/bin/bash
  VAR=0;
  
  while [ $VAR ]; do
      if nice -19 mysqldump -uuser -ppassword -h database.hostname.com --skip-opt --all --complete-insert --add-drop-table database_name &gt; ~/file/system/path/filename.sql; then
          VAR=1;
      fi
  done
  </code></pre>
  
  <p>So the script recovers from a killed process okay, but once it's run properly, the new <code>VAR</code> value doesn't kill the <code>while</code> loop.</p>
  
  <p>What am I doing wrong?</p>