
Steve Roylance wrote:
this is a Fedora 17 (32 bit) system and it is the inconsistent response from date that is throwing me at the moment, possibly the spaces is the command line are causing the error, or the leading 0 in the return to the date command.
[tmp]$ tst=$(( $(date +%H) * 3600 + $(date +%M) * 60 + $(date +%S) )); echo $tst bash: 00 * 3600 + 09: value too great for base (error token is "09")
You're getting leading zeroes from date, which are being treated as octal by expr. Do your date-time math using unix time -- date +s to generate, date -d@NNNNN to turn it back into a human format. You can also do some arithmetic using date itself, e.g. date -d '1 week ago 1970' (untested--I never found a good document of the syntaxes date -d accepts, so I just guess each time).