January 1, 2010
Happy New Year! And best wishes for a healthy and prosperous year for all my readers and their families.
On the first day of a new year it seems appropriate to write an exercise based on calendars. Unix provides a
cal command to print calendars. There are several forms:
cal— prints a calendar for the current month
calyear — prints a twelve-month calendar for the specified year; note that year 10 occurred during the time of Christ, so you must specify 2010 for the current year
calmonth year — prints a calendar for the specified month and year; the month is given as a number from 1 to 12
cal -3— prints a three-month calendar for the prior month, current month and next month
The current date is highlighted wherever it appears.
Pages: 1 2