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