1CAL(1P)                    POSIX Programmer's Manual                   CAL(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       cal — print a calendar
14

SYNOPSIS

16       cal [[month] year]
17

DESCRIPTION

19       The cal utility shall write a calendar to  standard  output  using  the
20       Julian  calendar  for dates from January 1, 1 through September 2, 1752
21       and the Gregorian calendar for dates from September  14,  1752  through
22       December  31, 9999 as though the Gregorian calendar had been adopted on
23       September 14, 1752.
24
25       If no operands are given, cal shall produce a  one-month  calendar  for
26       the  current  month  in  the  current year. If only the year operand is
27       given, cal shall produce a calendar for all twelve months in the  given
28       calendar  year.  If  both  month and year operands are given, cal shall
29       produce a one-month calendar for the given month in the given year.
30

OPTIONS

32       None.
33

OPERANDS

35       The following operands shall be supported:
36
37       month     Specify the month to be displayed, represented as  a  decimal
38                 integer from 1 (January) to 12 (December).
39
40       year      Specify  the year for which the calendar is displayed, repre‐
41                 sented as a decimal integer from 1 to 9999.
42

STDIN

44       Not used.
45

INPUT FILES

47       None.
48

ENVIRONMENT VARIABLES

50       The following environment variables shall affect the execution of cal:
51
52       LANG      Provide a default value for  the  internationalization  vari‐
53                 ables  that are unset or null. (See the Base Definitions vol‐
54                 ume of POSIX.1‐2008, Section 8.2, Internationalization  Vari‐
55                 ables  for  the  precedence of internationalization variables
56                 used to determine the values of locale categories.)
57
58       LC_ALL    If set to a non-empty string value, override  the  values  of
59                 all the other internationalization variables.
60
61       LC_CTYPE  Determine  the  locale for the interpretation of sequences of
62                 bytes of text data as characters (for example, single-byte as
63                 opposed to multi-byte characters in arguments).
64
65       LC_MESSAGES
66                 Determine the locale that should be used to affect the format
67                 and contents  of  diagnostic  messages  written  to  standard
68                 error, and informative messages written to standard output.
69
70       LC_TIME   Determine the format and contents of the calendar.
71
72       NLSPATH   Determine the location of message catalogs for the processing
73                 of LC_MESSAGES.
74
75       TZ        Determine the timezone used to calculate  the  value  of  the
76                 current month.
77

ASYNCHRONOUS EVENTS

79       Default.
80

STDOUT

82       The  standard  output  shall  be  used  to  display the calendar, in an
83       unspecified format.
84

STDERR

86       The standard error shall be used only for diagnostic messages.
87

OUTPUT FILES

89       None.
90

EXTENDED DESCRIPTION

92       None.
93

EXIT STATUS

95       The following exit values shall be returned:
96
97        0    Successful completion.
98
99       >0    An error occurred.
100

CONSEQUENCES OF ERRORS

102       Default.
103
104       The following sections are informative.
105

APPLICATION USAGE

107       Note that:
108
109           cal 83
110
111       refers to A.D. 83, not 1983.
112

EXAMPLES

114       None.
115

RATIONALE

117       Earlier versions of this standard incorrectly required  that  the  com‐
118       mand:
119
120           cal 2000
121
122       write  a  one-month  calendar for the current calendar month (no matter
123       what the current year is) in the year 2000 to standard output. This did
124       not  match  historic  practice in any known version of the cal utility.
125       The description has been updated to match historic practice.  When only
126       the  year  operand is given, cal writes a twelve-month calendar for the
127       specified year.
128

FUTURE DIRECTIONS

130       A future version of this standard may support locale-specific  recogni‐
131       tion of the date of adoption of the Gregorian calendar.
132

SEE ALSO

134       The  Base  Definitions  volume  of POSIX.1‐2008, Chapter 8, Environment
135       Variables
136
138       Portions of this text are reprinted and reproduced in  electronic  form
139       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
140       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
141       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
142       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
143       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
144       event of any discrepancy between this version and the original IEEE and
145       The  Open Group Standard, the original IEEE and The Open Group Standard
146       is the referee document. The original Standard can be  obtained  online
147       at http://www.unix.org/online.html .
148
149       Any  typographical  or  formatting  errors that appear in this page are
150       most likely to have been introduced during the conversion of the source
151       files  to  man page format. To report such errors, see https://www.ker
152       nel.org/doc/man-pages/reporting_bugs.html .
153
154
155
156IEEE/The Open Group                  2013                              CAL(1P)
Impressum