xref: /openbsd/usr.bin/calendar/calendar.1 (revision 17df1aa7)
1.\"	$OpenBSD: calendar.1,v 1.33 2007/05/31 19:20:08 jmc 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: May 31 2007 $
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 ab
41.Op Fl A Ar num
42.Op Fl B Ar num
43.Op Fl f Ar calendarfile
44.Op Fl t Ar [[[cc]yy][mm]]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 KOI8 calendars.
74.It Fl f Pa calendarfile
75Use
76.Pa calendarfile
77as the default calendar file.
78.It Fl t Ar [[[cc]yy][mm]]dd
79Act like the specified value is
80.Dq today
81instead of using the current date.
82.El
83.Pp
84To handle calendars in your national code table you can specify
85.Dq LANG=<locale_name>
86in the calendar file as early as possible.
87To handle national Easter names in the calendars,
88.Dq Easter=<national_name>
89(for Catholic Easter) or
90.Dq Paskha=<national_name>
91(for Orthodox Easter) can be used.
92.Pp
93The
94.Dq CALENDAR
95variable can be used to specify the style.
96Only
97.Sq Julian
98and
99.Sq Gregorian
100styles are currently supported.
101Use
102.Dq CALENDAR=
103to return to the default (Gregorian).
104.Pp
105To enforce special date calculation mode for Cyrillic calendars
106you should specify
107.Dq LANG=<local_name>
108and
109.Dq BODUN=<bodun_prefix>
110where <local_name> can be ru_RU.KOI8-R, uk_UA.KOI8-U or by_BY.KOI8-B.
111.Pp
112Other lines should begin with a month and day.
113They may be entered in almost any format, either numeric or as character
114strings.
115If proper locale is set, national months and weekdays
116names can be used.
117A single asterisk (`*') matches every month.
118A day without a month matches that day of every week.
119A month without a day matches the first of that month.
120Two numbers default to the month followed by the day.
121Lines with leading tabs default to the last entered date, allowing
122multiple line specifications for a single date.
123.Dq Easter
124(may be followed by a positive or negative integer) is Easter for this year.
125.Dq Paskha
126(may be followed by a positive or negative integer) is
127Orthodox Easter for this year.
128Weekdays may be followed by
129.Dq -4
130.Li ...
131.Dq +5
132(aliases last, first, second, third, fourth) for moving events like
133.Dq the last Monday in April .
134.Pp
135By convention, dates followed by an asterisk
136.Pq Sq *
137are not fixed, i.e., change
138from year to year.
139.Pp
140Day descriptions start after the first <tab> character in the line;
141if the line does not contain a <tab> character, it isn't printed out.
142If the first character in the line is a <tab> character, it is treated as
143the continuation of the previous description.
144.Pp
145The calendar file is preprocessed by
146.Xr cpp 1 ,
147allowing the inclusion of shared files such as company holidays or
148meetings.
149If the shared file is not referenced by a full pathname,
150.Xr cpp 1
151searches in the current (or home) directory first, and then in the
152directory
153.Pa /usr/share/calendar .
154Empty lines and lines protected by the C commenting syntax
155.Pq Li /* ... */
156are ignored.
157.Pp
158Some possible calendar entries
159(a \fB\et\fR sequence denotes a <tab> character):
160.Bd -unfilled -offset indent
161LANG=C
162Easter=Ostern
163
164#include <calendar.usholiday>
165#include <calendar.birthday>
166
1676/15\fB\et\fRJune 15 (if ambiguous, will default to month/day).
168Jun. 15\fB\et\fRJune 15.
16915 June\fB\et\fRJune 15.
170Thursday\fB\et\fREvery Thursday.
171June\fB\et\fREvery June 1st.
17215 *\fB\et\fR15th of every month.
173
174May Sun+2\fB\et\fRsecond Sunday in May (Muttertag)
17504/SunLast\fB\et\fRlast Sunday in April,
176\fB\et\fRsummer time in Europe
177Easter\fB\et\fREaster
178Ostern-2\fB\et\fRGood Friday (2 days before Easter)
179Paskha\fB\et\fROrthodox Easter
180.Ed
181.Sh FILES
182.Bl -tag -width ~/.calendar/calendar -compact
183.It Pa calendar
184File in current directory.
185.It Pa ~/.calendar
186Directory in the user's home directory (which
187.Nm
188changes into, if it exists).
189.It Pa ~/.calendar/calendar
190File to use if no calendar file exists in the current directory.
191.It Pa ~/.calendar/nomail
192.Nm
193will not send mail if this file exists.
194.It Pa calendar.all
195International and national calendar files.
196.It Pa calendar.birthday
197Births and deaths of famous (and not-so-famous) people.
198.It Pa calendar.christian
199Christian holidays (should be updated yearly by the local system administrator
200so that roving holidays are set correctly for the current year).
201.It Pa calendar.computer
202Days of special significance to computer people.
203.It Pa calendar.croatian
204Croatian calendar.
205.It Pa calendar.discord
206Discordian calendar (all rites reversed).
207.It Pa calendar.fictional
208Fantasy and fiction dates (mostly LOTR).
209.It Pa calendar.french
210French calendar.
211.It Pa calendar.german
212German calendar.
213.It Pa calendar.history
214Miscellaneous history.
215.It Pa calendar.holiday
216Other holidays (including the not-well-known, obscure, and
217.Em really
218obscure).
219.It Pa calendar.judaic
220Jewish holidays (should be updated yearly by the local system administrator
221so that roving holidays are set correctly for the current year).
222.It Pa calendar.music
223Musical events, births, and deaths (strongly oriented toward rock n' roll).
224.It Pa calendar.openbsd
225.Ox
226related events.
227.It Pa calendar.pagan
228Pagan holidays, celebrations and festivals.
229.It Pa calendar.russian
230Russian calendar.
231.It Pa calendar.space
232Cosmic history.
233.It Pa calendar.ushistory
234U.S. history.
235.It Pa calendar.usholiday
236U.S. holidays.
237.It Pa calendar.world
238World wide calendar.
239.El
240.Sh SEE ALSO
241.Xr at 1 ,
242.Xr cal 1 ,
243.Xr cpp 1 ,
244.Xr mail 1 ,
245.Xr cron 8
246.Sh STANDARDS
247The
248.Nm
249program previously selected lines which had the correct date anywhere
250in the line.
251This is no longer true: the date is only recognized when it occurs
252at the beginning of a line.
253.Sh HISTORY
254A
255.Nm
256command appeared in
257.At v7 .
258.Sh BUGS
259.Nm
260doesn't handle all Jewish holidays or moon phases.
261