Question : Mod calculations and "bad number "

1:
2:
3:
4:
MINUTE=`date +"%M"`
MINUTE_MOD=$((MINUTE%15))
]


Most of the time, the above works nicely.

Until you get to the start of the hour.....

08: bad number `08'

09: bad number `09'



Where am I going wrong ?

Answer : Mod calculations and "bad number "

OK,

OpenBSD has its own reimplementation of the Bourne shell, which I'm not really familiar with.

But nevertheless, my suggestion

MINUTE=${MINUTE##0}

should work in that shell.

wmp

Random Solutions  
 
programming4us programming4us