Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'The ultimate 3-column calendar' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
The ultimate 3-column calendar
Authored by: Herbo on Aug 03, '04 01:06:16PM

The problem seems to be how bash handles leading zeros, it treats the number as octal rather than base 10. Hence 8 is an invalid octal number (valid range being 0 to 7).

Try removing the leading zero from the month by changing the month assignment line to:

month=`date +%m | sed -e 's/^0//'`

-Herbo



[ Reply to This | # ]
The ultimate 3-column calendar
Authored by: icerabbit on Aug 03, '04 06:25:42PM

By Joe,
That works!
Thanks Herbo :)



[ Reply to This | # ]
The ultimate 3-column calendar
Authored by: gent99 on Aug 04, '04 03:30:58AM

Actually this is a bug in bash. look here:

http://lists.debian.org/debian-boot/2000/05/msg00287.html

i managed to fix it with the following code:

month=`expr $month + 0`

this is working too.



[ Reply to This | # ]