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