Debian Codegraph @

upstream/debian-unstable/man1/ncal.1

raw
1 .\" Copyright (c) 1997 Wolfgang Helbig
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD: head/usr.bin/ncal/ncal.1 359418 2020-03-29 04:14:57Z grog $
26 .\"
27 .Dd March 7, 2019
28 .Dt CAL 1
29 .Os
30 .Sh NAME
31 .Nm cal ,
32 .Nm ncal
33 .Nd displays a calendar and the date of Easter
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl 3hjy
37 .Op Fl A Ar number
38 .Op Fl B Ar number
39 .Oo
40 .Op Ar month
41 .Ar year
42 .Oc
43 .Nm
44 .Op Fl 3hj
45 .Op Fl A Ar number
46 .Op Fl B Ar number
47 .Fl m Ar month
48 .Op Ar year
49 .Nm ncal
50 .Op Fl 3bhjJpwySM
51 .Op Fl A Ar number
52 .Op Fl B Ar number
53 .Op Fl W Ar number
54 .Op Fl s Ar country_code
55 .Oo
56 .Op Ar month
57 .Ar year
58 .Oc
59 .Nm ncal
60 .Op Fl Jeo
61 .Op Fl A Ar number
62 .Op Fl B Ar number
63 .Op Ar year
64 .Nm ncal
65 .Op Fl CN
66 .Op Fl H Ar yyyy-mm-dd
67 .Op Fl d Ar yyyy-mm
68 .Sh DESCRIPTION
69 The
70 .Nm
71 utility displays a simple calendar in traditional format and
72 .Nm ncal
73 offers an alternative layout, more options and the date of Easter.
74 The new format is a little cramped but it makes a year fit
75 on a 25x80 terminal.
76 If arguments are not specified,
77 the current month is displayed.
78 .Pp
79 The options are as follows:
80 .Bl -tag -width indent
81 .It Fl h
82 Turns off highlighting of today.
83 .It Fl J
84 Display Julian Calendar, if combined with the
85 .Fl o
86 option, display date of Orthodox Easter according to the Julian Calendar.
87 .It Fl e
88 Display date of Easter (for western churches).
89 .It Fl j
90 Display Julian days (days one-based, numbered from January 1).
91 .It Fl m Ar month
92 Display the specified
93 .Ar month .
94 If
95 .Ar month
96 is specified as a decimal number, appending
97 .Ql f
98 or
99 .Ql p
100 displays the same month of the following or previous year respectively.
101 .It Fl o
102 Display date of Orthodox Easter (Greek and Russian
103 Orthodox Churches).
104 .It Fl p
105 Print the country codes and switching days from Julian to Gregorian
106 Calendar as they are assumed by
107 .Nm ncal .
108 The country code as determined from the local environment is marked
109 with an asterisk.
110 .It Fl s Ar country_code
111 Assume the switch from Julian to Gregorian Calendar at the date
112 associated with the
113 .Ar country_code .
114 If not specified,
115 .Nm ncal
116 tries to guess the switch date from the local environment or
117 falls back to September 2, 1752.
118 This was when Great
119 Britain and her colonies switched to the Gregorian Calendar.
120 .It Fl w
121 Print the number of the week below each week column.
122 .It Fl y
123 Display a calendar for the specified year. This option is implied when
124 a year but no month are specified on the command line.
125 .It Fl 3
126 Display the previous, current and next month surrounding today.
127 .It Fl 1
128 Display only the current month. This is the default.
129 .It Fl A Ar number
130 Months to add after. The specified number of months is added to the
131 end of the display. This is in addition to any date range selected by the
132 .Fl y ,
133 .Fl 3 ,
134 or
135 .Fl 1
136 options. For example,
137 .Dq Li cal -y -B2 -A2
138 shows everything from November of the previous year to
139 February of the following year. Negative numbers are allowed, in which
140 case the specified number of months is subtracted. For example,
141 .Dq Li cal -y -B-6
142 shows July to December. And
143 .Dq Li cal -A11
144 simply shows the next 12 months.
145 .It Fl B Ar number
146 Months to add before. The specified number of months is added to the
147 beginning of the display. See
148 .Fl A
149 for examples.
150 .It Fl C
151 Completely switch to
152 .Nm cal
153 mode. For
154 .Nm cal
155 like output only, use
156 .Fl b
157 instead.
158 .It Fl d Ar yyyy-mm
159 Use
160 .Ar yyyy-mm
161 as the current date (for debugging of date selection).
162 .It Fl H Ar yyyy-mm-dd
163 Use
164 .Ar yyyy-mm-dd
165 as the current date (for debugging of highlighting).
166 .It Fl M
167 Weeks start on Monday.
168 .It Fl S
169 Weeks start on Sunday.
170 .It Fl W Ar number
171 First week of the year has at least
172 .Ar number
173 days.
174 .It Fl b
175 Use oldstyle format for ncal output.
176 .El
177 .Pp
178 A single parameter specifies the year (1\(en9999) to be displayed;
179 note the year must be fully specified:
180 .Dq Li cal 89
181 will
182 .Em not
183 display a calendar for 1989.
184 Two parameters denote the month and
185 year; the month is either a number between 1 and 12, or a full or
186 abbreviated name as specified by the current locale.
187 Month and
188 year default to those of the current system clock and time zone (so
189 .Dq Li cal -m 8
190 will display a calendar for the month of August in the current
191 year).
192 .Pp
193 Not all options can be used together.
194 For example the options
195 .Fl y , 3 ,
196 and
197 .Fl 1
198 are mutually exclusive. If inconsistent options are given, the later
199 ones take precedence over the earlier ones.
200 .Pp
201 A year starts on January 1.
202 .Pp
203 Highlighting of dates is disabled if stdout is not a tty.
204 .Sh SEE ALSO
205 .Xr calendar 3 ,
206 .Xr strftime 3
207 .Sh STANDARDS
208 The
209 .Nm
210 utility is compliant with the
211 X/Open System Interfaces option of the
212 .St -p1003.1-2008
213 specification.
214 .Pp
215 The flags
216 .Op Fl 3hyJeopw ,
217 as well as the ability to specify a month name as a single argument,
218 are extensions to that specification.
219 .Pp
220 The week number computed by
221 .Fl w
222 is compliant with the
223 .St -iso8601
224 specification.
225 .Sh HISTORY
226 A
227 .Nm
228 command appeared in
229 .At v1 .
230 The
231 .Nm ncal
232 command appeared in
233 .Fx 2.2.6 .
234 The output of the
235 .Nm cal
236 command is supposed to be bit for bit compatible to the original Unix
237 .Nm cal
238 command, because its output is processed by other programs like CGI scripts,
239 that should not be broken. Therefore it will always output 8 lines, even if
240 only 7 contain data. This extra blank line also appears with the original
241 .Nm cal
242 command, at least on Solaris 8
243 .Sh AUTHORS
244 The
245 .Nm ncal
246 command and manual were written by
247 .An Wolfgang Helbig Aq Mt [email protected] .
248 .Sh BUGS
249 The assignment of Julian\(enGregorian switching dates to country
250 codes is historically naive for many countries.
251 .Pp
252 Not all options are compatible and using them in different orders
253 will give varying results.
254 .Pp
255 It is not possible to display Monday as the first day of the week with
256 .Nm cal .