Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)
cal(1) OSS Shell and Utilities Reference Manual
NAME
cal - Displays a calendar
SYNOPSIS
cal [[month] year]
DESCRIPTION
The cal command writes to the standard output file a Gregorian calendar for the specified month
or year.
If you provide two operands, cal assumes the first to be month and the second to be year. The
month operand specifies the month for which you want the calendar, and it must be a number in
the range 1 through 12 for January through December, respectively. The year operand specifies
the year for which you want the calendar, and it must be a number in the range 1 through 9999.
Because cal can display a calendar for any year in this range, enter a full 4-digit year (for exam-
ple, 1993) rather than just the last two digits.
If you provide only one operand, cal assumes that operand to be year (even if it is in the range 1
through 12) and displays a calendar for all 12 months of that year.
If you do not provide any operands, cal displays a calendar for the current month of the current
year.
Environment Variables
The cal command checks the LC_TIME environment variable and uses the correct headers for
the current locale. If LC_TIME is not set, cal checks the value of LANG. If neither variable is
set, you receive English headers.
EXAMPLES
1. To display a calendar for February 1999, enter:
cal 2 1999
2. To print a calendar for the entire year of 1999, enter:
cal 1999 print
3. To display a calendar for the year 84 of the Common Era, enter:
cal 84
EXIT VALUES
The cal command returns the following exit values:
0 (zero) The cal utility successfully finished its processing.
>0 An error occurred.
RELATED INFORMATION
Files: locale(4).
STANDARDS CONFORMANCE
This command conforms to the XPG4 Version 2 specification with extensions, except for the fol-
lowing features:
• The SHELL and TZ environment variables are not used.
2−64 Hewlett-Packard Company 527188-021