title: Bash script, Illegal number: 08
body: <p>I'm running a pretty simple bash script in ubuntu but have come up with a problem.
  If needed I'll post the whole script, but I've narrowed down the problem.
  Basically, I want to run some code every 15 seconds, so I started with this:</p>
  
  <pre><code>time=`date +%S`
  
  time2=$((time%15))
  
  if [ $time2 -eq 0 ]
  
  then
  </code></pre>
  
  <p>etc, etc, etc....</p>
  
  <p>The problem comes up when time is 08 seconds. The script terminates with Illegal number: 08.
  Adding to that, when using:</p>
  
  <pre><code>time2=$(($time%15))
  </code></pre>
  
  <p>instead of the illegal number error, it would terminate with Arithmetic expression: expecting EOF: "08%15"</p>
  
  <p>I'm guessing 08 isn't interpreted as a number. Or there's some base issue, like it thinks it's in octal or something. Any help?</p>