xref: /freebsd/usr.bin/calendar/calendar.1 (revision 1e413cf93298b5b97441a21d9a50fdcd0ee9945e)
1.\" Copyright (c) 1989, 1990, 1993
2.\"     The Regents of the University of California.  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.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"     This product includes software developed by the University of
15.\"     California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)calendar.1  8.1 (Berkeley) 6/29/93
33.\" $FreeBSD$
34.\"
35.Dd June 13, 2002
36.Dt CALENDAR 1
37.Os
38.Sh NAME
39.Nm calendar
40.Nd reminder service
41.Sh SYNOPSIS
42.Nm
43.Op Fl a
44.Op Fl A Ar num
45.Op Fl B Ar num
46.Op Fl F Ar friday
47.Op Fl f Ar calendarfile
48.Oo
49.Bk -words
50.Fl t Ar dd Ns
51.Sm off
52.Op . Ar mm Op . Ar year
53.Sm on
54.Ek
55.Oc
56.Op Fl W Ar num
57.Sh DESCRIPTION
58The
59.Nm
60utility checks the current directory for a file named
61.Pa calendar
62and displays lines that begin with either today's date
63or tomorrow's.
64On the day before a weekend (normally Friday), events for the next
65three days are displayed.
66.Pp
67The following options are available:
68.Bl -tag -width Ds
69.It Fl A Ar num
70Print lines from today and the next
71.Ar num
72days (forward, future).
73.It Fl a
74Process the ``calendar'' files of all users and mail the results
75to them.
76This requires super-user privileges.
77.It Fl B Ar num
78Print lines from today and the previous
79.Ar num
80days (backward, past).
81.It Fl F Ar friday
82Specify which day of the week is ``Friday'' (the day before the
83weekend begins).
84Default is 5.
85.It Fl f Pa calendarfile
86Use
87.Pa calendarfile
88as the default calendar file.
89.It Xo Fl t
90.Sm off
91.Ar dd
92.Op . Ar mm Op . Ar year
93.Sm on
94.Xc
95For test purposes only: set date directly to argument values.
96.It Fl W Ar num
97Print lines from today and the next
98.Ar num
99days (forward, future).
100Ignore weekends when calculating the number of days.
101.El
102.Pp
103To handle calendars in your national code table you can specify
104.Dq LANG=<locale_name>
105in the calendar file as early as possible.
106To handle national Easter
107names in the calendars
108.Dq Easter=<national_name>
109(for Catholic Easter) or
110.Dq Paskha=<national_name>
111(for Orthodox Easter) can be used.
112.Pp
113Other lines should begin with a month and day.
114They may be entered in almost any format, either numeric or as character
115strings.
116If the proper locale is set, national month and weekday
117names can be used.
118A single asterisk (``*'') matches every month.
119A day without a month matches that day of every week.
120A month without a day matches the first of that month.
121Two numbers default to the month followed by the day.
122Lines with leading tabs default to the last entered date, allowing
123multiple line specifications for a single date.
124.Pp
125``Easter'', is Easter for this year, and may be followed by a positive
126or negative integer.
127.Pp
128``Paskha'', is Orthodox Easter for this year, and may be followed by a
129positive or negative integer.
130.Pp
131Weekdays may be followed by ``-4'' ...\& ``+5'' (aliases for
132last, first, second, third, fourth) for moving events like
133``the last Monday in April''.
134.Pp
135By convention, dates followed by an asterisk are not fixed, i.e., change
136from year to year.
137.Pp
138Day descriptions start after the first <tab> character in the line;
139if the line does not contain a <tab> character, it is not displayed.
140If the first character in the line is a <tab> character, it is treated as
141a continuation of the previous line.
142.Pp
143The ``calendar'' file is preprocessed by
144.Xr cpp 1 ,
145allowing the inclusion of shared files such as lists of company holidays or
146meetings.
147If the shared file is not referenced by a full pathname,
148.Xr cpp 1
149searches in the current (or home) directory first, and then in the
150directory
151.Pa /usr/share/calendar .
152Empty lines and lines protected by the C commenting syntax
153.Pq Li /* ... */
154are ignored.
155.Pp
156Some possible calendar entries (<tab> characters highlighted by
157\fB\et\fR sequence)
158.Bd -unfilled -offset indent
159LANG=C
160Easter=Ostern
161
162#include <calendar.usholiday>
163#include <calendar.birthday>
164
1656/15\fB\et\fRJune 15 (if ambiguous, will default to month/day).
166Jun. 15\fB\et\fRJune 15.
16715 June\fB\et\fRJune 15.
168Thursday\fB\et\fREvery Thursday.
169June\fB\et\fREvery June 1st.
17015 *\fB\et\fR15th of every month.
171
172May Sun+2\fB\et\fRsecond Sunday in May (Muttertag)
17304/SunLast\fB\et\fRlast Sunday in April,
174\fB\et\fRsummer time in Europe
175Easter\fB\et\fREaster
176Ostern-2\fB\et\fRGood Friday (2 days before Easter)
177Paskha\fB\et\fROrthodox Easter
178
179.Ed
180.Sh FILES
181.Bl -tag -width calendar.christian -compact
182.It Pa calendar
183file in current directory
184.It Pa ~/.calendar
185.Pa calendar
186HOME directory.
187A chdir is done into this directory if it exists.
188.It Pa ~/.calendar/calendar
189calendar file to use if no calendar file exists in the current directory.
190.It Pa ~/.calendar/nomail
191do not send mail if this file exists.
192.El
193.Pp
194The following default calendar files are provided:
195.Pp
196.Bl -tag -width calendar.southafrica -compact
197.It Pa calendar.all
198File which includes all the default files.
199.It Pa calendar.australia
200Calendar of events in Australia.
201.It Pa calendar.birthday
202Births and deaths of famous (and not-so-famous) people.
203.It Pa calendar.christian
204Christian holidays.
205This calendar should be updated yearly by the local system administrator
206so that roving holidays are set correctly for the current year.
207.It Pa calendar.computer
208Days of special significance to computer people.
209.It Pa calendar.croatian
210Calendar of events in Croatia.
211.It Pa calendar.freebsd
212Birthdays of
213.Fx
214committers.
215.It Pa calendar.french
216Calendar of events in France.
217.It Pa calendar.german
218Calendar of events in Germany.
219.It Pa calendar.history
220Everything else, mostly U.S.\& historical events.
221.It Pa calendar.holiday
222Other holidays, including the not-well-known, obscure, and
223.Em really
224obscure.
225.It Pa calendar.judaic
226Jewish holidays.
227This calendar should be updated yearly by the local system administrator
228so that roving holidays are set correctly for the current year.
229.It Pa calendar.music
230Musical events, births, and deaths.
231Strongly oriented toward rock 'n' roll.
232.It Pa calendar.newzealand
233Calendar of events in New Zealand.
234.It Pa calendar.russian
235Russian calendar.
236.It Pa calendar.southafrica
237Calendar of events in South Africa.
238.It Pa calendar.usholiday
239U.S.\& holidays.
240This calendar should be updated yearly by the local system administrator
241so that roving holidays are set correctly for the current year.
242.It Pa calendar.world
243Includes all calendar files except for national files.
244.El
245.Sh COMPATIBILITY
246The
247.Nm
248program previously selected lines which had the correct date anywhere
249in the line.
250This is no longer true, the date is only recognized when it occurs
251at the beginning of a line.
252.Sh SEE ALSO
253.Xr at 1 ,
254.Xr cpp 1 ,
255.Xr mail 1 ,
256.Xr cron 8
257.Sh HISTORY
258A
259.Nm
260command appeared in
261.At v7 .
262.Sh BUGS
263The
264.Nm
265utility does not handle Jewish holidays and moon phases.
266