Tugger the SLUGger!SLUG Mailing List Archives

Re: let: 08: value too great for base (error token is "08") Re: [SLUG] passing parameter to a shell script


> the script seems to work in as far as it proces the logs through awstats,
> but, ocassionaly I get these errors:

> ./awstatsproc: let: 08: value too great for base (error token is "08")
> ./awstatsproc: let: 09: value too great for base (error token is "09")

Numbers starting with leading 0 are Octal numbers  (base 8) in many programming
languages including C, Perl and shell. Valid octal digits are 
0,1,2,3,4,5,6,7 so it barfs if it sees an 8 or a 9. You probably want
to work in straight numbers and make a leading 0 in your output
format with a sprintf("%02d") kind of formatting thing.
Anything starting with 0x or 0X is a hex number.

So the error message means exactly as it says- it's an error from
the let function complaining about the value being too big for the base.

Have fun,
Stuart.