Hi,
I am having the following problem.
test > hourOfDay=06 ; delayTime=$(((9-$hourOfDay)*60)) ; echo $delayTime
180
test > hourOfDay=07 ; delayTime=$(((9-$hourOfDay)*60)) ; echo $delayTime
120
test > hourOfDay=08 ; delayTime=$(((9-$hourOfDay)*60)) ; echo $delayTime
bash: (9-08: value too great for base (error token is "08")
test > hourOfDay=09 ; delayTime=$(((9-$hourOfDay)*60)) ; echo $delayTime
bash: (9-09: value too great for base (error token is "09")
test > hourOfDay=10 ; delayTime=$(((9-$hourOfDay)*60)) ; echo $delayTime
-60
you can see where hourOfDay = 08 or 09 I get the error
bash: (9-08: value too great for base (error token is "08")
does it think that these are base 8 numbers ?
because of the leading "0" ?
In my script I get the hourOfDay using
hourOfDay=$(date +%H)
Is there an easy way to strip off the '0', if that is the problem ?
(sorry if this is an easy thing, I mess with scripts less than once a month,
so not very experienced).
Thanks !
joe