xref: /openbsd/usr.bin/calendar/calendar.1 (revision 4bdff4be)
1.\"	$OpenBSD: calendar.1,v 1.44 2019/01/29 22:28:30 tedu Exp $
2.\"
3.\" Copyright (c) 1989, 1990, 1993
4.\"     The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     @(#)calendar.1  8.1 (Berkeley) 6/29/93
31.\"
32.Dd $Mdocdate: January 29 2019 $
33.Dt CALENDAR 1
34.Os
35.Sh NAME
36.Nm calendar
37.Nd reminder service
38.Sh SYNOPSIS
39.Nm calendar
40.Op Fl abw
41.Op Fl A Ar num
42.Op Fl B Ar num
43.Op Fl f Ar calendarfile
44.Op Fl t Oo Oo Oo Ar cc Oc Ns Ar yy Oc Ns Ar mm Oc Ns Ar dd
45.Sh DESCRIPTION
46The
47.Nm
48utility checks the current directory or the directory specified by the
49.Ev CALENDAR_DIR
50environment variable for a file named
51.Pa calendar
52and displays lines that begin with either today's date
53or tomorrow's.
54On Fridays, events on Friday through Monday are displayed.
55.Pp
56The options are as follows:
57.Bl -tag -width Ds
58.It Fl A Ar num
59Print lines from today and next
60.Ar num
61days (forward, future).
62.It Fl a
63Process the
64.Dq calendar
65files of all users and mail the results
66to them.
67This requires superuser privileges.
68.It Fl B Ar num
69Print lines from today and previous
70.Ar num
71days (backward, past).
72.It Fl b
73Enforce special date calculation mode for Cyrillic calendars.
74.It Fl f Ar calendarfile
75Use
76.Ar calendarfile
77as the default calendar file.
78.It Fl t Oo Oo Oo Ar cc Oc Ns Ar yy Oc Ns Ar mm Oc Ns Ar dd
79Act like the specified value is
80.Dq today
81instead of using the current date.
82If yy is specified, but cc is not,
83a value for yy between 69 and 99 results in a cc value of 19.
84Otherwise, a cc value of 20 is used.
85.It Fl w
86Print day of the week name in front of each event.
87.El
88.Pp
89To handle calendars in your national code table you can specify
90.Dq LANG=<locale_name>
91in the calendar file as early as possible.
92To handle national Easter names in the calendars,
93.Dq Easter=<national_name>
94(for Catholic Easter) or
95.Dq Paskha=<national_name>
96(for Orthodox Easter) can be used.
97.Pp
98The
99.Dq CALENDAR
100variable can be used to specify the style.
101Only
102.Sq Julian
103and
104.Sq Gregorian
105styles are currently supported.
106Use
107.Dq CALENDAR=
108to return to the default (Gregorian).
109.Pp
110To enforce special date calculation mode for Cyrillic calendars
111you should specify
112.Dq LANG=<local_name>
113and
114.Dq BODUN=<bodun_prefix>
115where <local_name> can be ru_RU.UTF-8, uk_UA.UTF-8 or by_BY.UTF-8.
116.Pp
117Other lines should begin with a month and day.
118They may be entered in almost any format, either numeric or as character
119strings.
120If proper locale is set, national months and weekdays
121names can be used.
122A single asterisk
123.Pq Sq *
124matches every month.
125A day without a month matches that day of every week.
126A month without a day matches the first of that month.
127Two numbers default to the month followed by the day.
128Lines with leading tabs default to the last entered date, allowing
129multiple line specifications for a single date.
130.Dq Easter
131(may be followed by a positive or negative integer) is Easter for this year.
132.Dq Paskha
133(may be followed by a positive or negative integer) is
134Orthodox Easter for this year.
135Weekdays may be followed by
136.Dq -4
137.Li ...
138.Dq +5
139(aliases last, first, second, third, fourth) for moving events like
140.Dq the last Monday in April .
141.Pp
142By convention, dates followed by an asterisk
143.Pq Sq *
144are not fixed, i.e., change
145from year to year.
146.Pp
147Day descriptions start after the first <tab> character in the line;
148if the line does not contain a <tab> character, it isn't printed out.
149If the first character in the line is a <tab> character, it is treated as
150the continuation of the previous description.
151.Pp
152The calendar file is preprocessed by
153.Xr cpp 1 ,
154allowing the inclusion of shared files such as company holidays or
155meetings.
156If the shared file is not referenced by a full pathname,
157.Xr cpp 1
158searches in the current (or home) directory first, and then in the
159directory
160.Pa /usr/share/calendar .
161Empty lines and lines protected by the C commenting syntax
162.Pq Li /* ... */
163are ignored.
164.Pp
165Some possible calendar entries
166(a \fB\et\fR sequence denotes a <tab> character):
167.Bd -unfilled -offset indent
168LANG=C
169Easter=Ostern
170
171#include <calendar.usholiday>
172#include <calendar.birthday>
173
1746/15\fB\et\fRJune 15 (if ambiguous, will default to month/day).
175Jun. 15\fB\et\fRJune 15.
17615 June\fB\et\fRJune 15.
177Thursday\fB\et\fREvery Thursday.
178June\fB\et\fREvery June 1st.
17915 *\fB\et\fR15th of every month.
180
181May Sun+2\fB\et\fRsecond Sunday in May (Muttertag)
18204/SunLast\fB\et\fRlast Sunday in April,
183\fB\et\fRsummer time in Europe
184Easter\fB\et\fREaster
185Ostern-2\fB\et\fRGood Friday (2 days before Easter)
186Paskha\fB\et\fROrthodox Easter
187.Ed
188.Sh FILES
189.Bl -tag -width ~/.calendar/calendar -compact
190.It Pa calendar
191File in current directory.
192.It Pa ~/.calendar
193Directory in the user's home directory (which
194.Nm
195changes into, if it exists).
196.It Pa ~/.calendar/calendar
197File to use if no calendar file exists in the current directory.
198.It Pa ~/.calendar/nomail
199.Nm
200will not send mail if this file exists.
201.It Pa calendar.all
202International and national calendar files.
203.It Pa calendar.birthday
204Births and deaths of famous (and not-so-famous) people.
205.It Pa calendar.canada
206Canadian holidays.
207.It Pa calendar.christian
208Christian holidays (should be updated yearly by the local system administrator
209so that roving holidays are set correctly for the current year).
210.It Pa calendar.computer
211Days of special significance to computer people.
212.It Pa calendar.croatian
213Croatian calendar.
214.It Pa calendar.discord
215Discordian calendar (all rites reversed).
216.It Pa calendar.fictional
217Fantasy and fiction dates (mostly LOTR).
218.It Pa calendar.french
219French calendar.
220.It Pa calendar.german
221German calendar.
222.It Pa calendar.history
223Miscellaneous history.
224.It Pa calendar.holiday
225Other holidays (including the not-well-known, obscure, and
226.Em really
227obscure).
228.It Pa calendar.judaic
229Jewish holidays (should be updated yearly by the local system administrator
230so that roving holidays are set correctly for the current year).
231.It Pa calendar.music
232Musical events, births, and deaths (strongly oriented toward rock 'n' roll).
233.It Pa calendar.nz
234New Zealand calendar.
235.It Pa calendar.openbsd
236.Ox
237related events.
238.It Pa calendar.pagan
239Pagan holidays, celebrations and festivals.
240.It Pa calendar.russian
241Russian calendar.
242.It Pa calendar.space
243Cosmic history.
244.It Pa calendar.uk
245UK calendar.
246.It Pa calendar.ushistory
247U.S. history.
248.It Pa calendar.usholiday
249U.S. holidays.
250.It Pa calendar.world
251World wide calendar.
252.El
253.Sh SEE ALSO
254.Xr at 1 ,
255.Xr cal 1 ,
256.Xr cpp 1 ,
257.Xr mail 1 ,
258.Xr cron 8
259.Sh STANDARDS
260The
261.Nm
262program previously selected lines which had the correct date anywhere
263in the line.
264This is no longer true: the date is only recognized when it occurs
265at the beginning of a line.
266.Sh HISTORY
267A
268.Nm
269command appeared in
270.At v7 .
271.Sh BUGS
272.Nm
273doesn't handle all Jewish holidays or moon phases.
274