
hi I need some help with this simple bash script, I ran the script twice, the first time it failed on some bash arithmetic, I then ran it again without changing anything and it worked, so I slightly puzzled as lines 8&11 are the same and sometimes it evaluates it and sometimes not. Steve --------------------------------------------------------------- [bin]$ cat world #!/usr/bin/bash cd /home/thorfinn/projects/image/clouds/ d=`date +%Y-%m-%d` mkdir $d cd $d pwd let tst=`date +%H`*3600+`date +%M`*60+`date +%S` echo $tst sleep 10 let tq=`date +%H`*3600+`date +%M`*60+`date +%S` while [ $tq -gt $tst ] # watch a web graphic of clouds and grab every 30 minutes # the while statement is to stop at midnight. --------------------------------------------------------------- [bin]$ ./world mkdir: cannot create directory `2012-08-19': File exists /home/thorfinn/projects/image/clouds/2012-08-19 ./world: line 8: let: tst=20*3600+42*60+09: value too great for base (error token is "09") ./world: line 13: [: 74539: unary operator expected [bin]$ ./world mkdir: cannot create directory `2012-08-19': File exists /home/thorfinn/projects/image/clouds/2012-08-19 74544 ---------------------------------------------------------------