xref: /minix3/usr.bin/calendar/calendar.1 (revision 37fc2fa18fbfb5fda26f1400931b040e37a78f9a)
1*37fc2fa1SThomas Cort.\"	$NetBSD: calendar.1,v 1.25 2010/06/08 03:08:47 riz Exp $
2*37fc2fa1SThomas Cort.\"
3*37fc2fa1SThomas Cort.\" Copyright (c) 1989, 1990, 1993
4*37fc2fa1SThomas Cort.\"	The Regents of the University of California.  All rights reserved.
5*37fc2fa1SThomas Cort.\"
6*37fc2fa1SThomas Cort.\" Redistribution and use in source and binary forms, with or without
7*37fc2fa1SThomas Cort.\" modification, are permitted provided that the following conditions
8*37fc2fa1SThomas Cort.\" are met:
9*37fc2fa1SThomas Cort.\" 1. Redistributions of source code must retain the above copyright
10*37fc2fa1SThomas Cort.\"    notice, this list of conditions and the following disclaimer.
11*37fc2fa1SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
12*37fc2fa1SThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
13*37fc2fa1SThomas Cort.\"    documentation and/or other materials provided with the distribution.
14*37fc2fa1SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
15*37fc2fa1SThomas Cort.\"    may be used to endorse or promote products derived from this software
16*37fc2fa1SThomas Cort.\"    without specific prior written permission.
17*37fc2fa1SThomas Cort.\"
18*37fc2fa1SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19*37fc2fa1SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20*37fc2fa1SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21*37fc2fa1SThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22*37fc2fa1SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23*37fc2fa1SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24*37fc2fa1SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25*37fc2fa1SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26*37fc2fa1SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27*37fc2fa1SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28*37fc2fa1SThomas Cort.\" SUCH DAMAGE.
29*37fc2fa1SThomas Cort.\"
30*37fc2fa1SThomas Cort.\"     @(#)calendar.1	8.1 (Berkeley) 6/29/93
31*37fc2fa1SThomas Cort.\"
32*37fc2fa1SThomas Cort.Dd August 27, 2009
33*37fc2fa1SThomas Cort.Dt CALENDAR 1
34*37fc2fa1SThomas Cort.Os
35*37fc2fa1SThomas Cort.Sh NAME
36*37fc2fa1SThomas Cort.Nm calendar
37*37fc2fa1SThomas Cort.Nd reminder service
38*37fc2fa1SThomas Cort.Sh SYNOPSIS
39*37fc2fa1SThomas Cort.Nm
40*37fc2fa1SThomas Cort.Op Fl ax
41*37fc2fa1SThomas Cort.Op Fl d Ar MMDD[[YY]YY]
42*37fc2fa1SThomas Cort.Op Fl f Ar file
43*37fc2fa1SThomas Cort.Op Fl l Ar days
44*37fc2fa1SThomas Cort.Op Fl w Ar days
45*37fc2fa1SThomas Cort.Sh DESCRIPTION
46*37fc2fa1SThomas CortThe
47*37fc2fa1SThomas Cort.Nm
48*37fc2fa1SThomas Cortutility processes text files and displays lines that match certain dates.
49*37fc2fa1SThomas Cort.Pp
50*37fc2fa1SThomas CortThe following options are available:
51*37fc2fa1SThomas Cort.Bl -tag -width Ds
52*37fc2fa1SThomas Cort.It Fl a
53*37fc2fa1SThomas CortProcess the
54*37fc2fa1SThomas Cort.Dq calendar
55*37fc2fa1SThomas Cortfiles of all users and mail the results to them.
56*37fc2fa1SThomas CortThis requires super-user privileges.
57*37fc2fa1SThomas Cort.It Fl d Ar MMDD[[YY]YY]
58*37fc2fa1SThomas CortDisplay lines for the given date.
59*37fc2fa1SThomas CortBy default, the current date is used.
60*37fc2fa1SThomas CortThe year, which may be given in either two or four digit format, is used
61*37fc2fa1SThomas Cortonly for purposes of determining whether the given date falls on a Friday
62*37fc2fa1SThomas Cortin that year (see below).
63*37fc2fa1SThomas CortIf the year is not specified, the current year is assumed.
64*37fc2fa1SThomas Cort.It Fl f Ar file
65*37fc2fa1SThomas CortDisplay matching calendar files from the given filename.
66*37fc2fa1SThomas CortBy default, the following filenames are checked for:
67*37fc2fa1SThomas Cort.Bl -item -compact -offset indent
68*37fc2fa1SThomas Cort.It
69*37fc2fa1SThomas Cort.Pa ~/calendar
70*37fc2fa1SThomas Cort.It
71*37fc2fa1SThomas Cort.Pa ~/.calendar
72*37fc2fa1SThomas Cort.It
73*37fc2fa1SThomas Cort.Pa /etc/calendar
74*37fc2fa1SThomas Cort.El
75*37fc2fa1SThomas Cortand the first which is found is used.
76*37fc2fa1SThomas CortThe filename may be absolute.
77*37fc2fa1SThomas CortIf not absolute, it is taken relative to the
78*37fc2fa1SThomas Cortdirectory specified by the
79*37fc2fa1SThomas Cort.Ev CALENDAR_DIR
80*37fc2fa1SThomas Cortenvironment variable, if set; otherwise, it is taken relative to the
81*37fc2fa1SThomas Cortuser's home directory.
82*37fc2fa1SThomas CortOr, if the
83*37fc2fa1SThomas Cort.Fl a
84*37fc2fa1SThomas Cortflag is given, a non-absolute filename is taken relative to each user's
85*37fc2fa1SThomas Corthome directory in turn.
86*37fc2fa1SThomas Cort.It Fl l Ar days
87*37fc2fa1SThomas CortCauses the program to
88*37fc2fa1SThomas Cort.Dq look ahead
89*37fc2fa1SThomas Corta given number of days (default one) from the specified date and
90*37fc2fa1SThomas Cortdisplay their entries as well.
91*37fc2fa1SThomas Cort.It Fl w Ar days
92*37fc2fa1SThomas CortCauses the program to add the specified number of days to the
93*37fc2fa1SThomas Cort.Dq look ahead
94*37fc2fa1SThomas Cortnumber if and only if the day specified is a Friday.
95*37fc2fa1SThomas CortThe default value is two, which causes
96*37fc2fa1SThomas Cort.Nm
97*37fc2fa1SThomas Cortto print entries through the weekend on Fridays.
98*37fc2fa1SThomas Cort.It Fl x
99*37fc2fa1SThomas CortCauses
100*37fc2fa1SThomas Cort.Nm
101*37fc2fa1SThomas Cortnot to set the
102*37fc2fa1SThomas Cort.Ev CPP_RESTRICTED
103*37fc2fa1SThomas Cortenvironment variable.
104*37fc2fa1SThomas CortPassing this flag allows users the (somewhat obscure) option of
105*37fc2fa1SThomas Cortincluding a named pipe via
106*37fc2fa1SThomas Cort.Xr cpp 1 Ns No 's
107*37fc2fa1SThomas Cort.Li #include
108*37fc2fa1SThomas Cortsyntax, but opens up the possibility of
109*37fc2fa1SThomas Cort.Nm
110*37fc2fa1SThomas Corthanging indefinitely if users do so incorrectly.
111*37fc2fa1SThomas CortFor this reason, the
112*37fc2fa1SThomas Cort.Fl x
113*37fc2fa1SThomas Cortflag should never be used with
114*37fc2fa1SThomas Cort.Nm
115*37fc2fa1SThomas Cort.Fl a .
116*37fc2fa1SThomas Cort.El
117*37fc2fa1SThomas Cort.Pp
118*37fc2fa1SThomas CortLines should begin with a month and day.
119*37fc2fa1SThomas CortThey may be entered in almost any format, either numeric or as character
120*37fc2fa1SThomas Cortstrings.
121*37fc2fa1SThomas CortA single asterisk
122*37fc2fa1SThomas Cort.Pq Sq *
123*37fc2fa1SThomas Cortmatches every month, or every day if a month has been provided.
124*37fc2fa1SThomas CortThis means that two asterisks
125*37fc2fa1SThomas Cort.Pq Sq **
126*37fc2fa1SThomas Cortmatches every day of the year, and is thus useful for ToDo tasks.
127*37fc2fa1SThomas CortA day without a month matches that day of every week.
128*37fc2fa1SThomas CortA month without a day matches the first of that month.
129*37fc2fa1SThomas CortTwo numbers default to the month followed by the day.
130*37fc2fa1SThomas CortLines with leading tabs default to the last entered date, allowing
131*37fc2fa1SThomas Cortmultiple line specifications for a single date.
132*37fc2fa1SThomas CortBy convention, dates followed by an asterisk are not fixed, i.e., change
133*37fc2fa1SThomas Cortfrom year to year.
134*37fc2fa1SThomas Cort.Pp
135*37fc2fa1SThomas CortThe
136*37fc2fa1SThomas Cort.Dq calendar
137*37fc2fa1SThomas Cortfile is preprocessed by
138*37fc2fa1SThomas Cort.Xr cpp 1 ,
139*37fc2fa1SThomas Cortallowing the inclusion of shared files such as company holidays or
140*37fc2fa1SThomas Cortmeetings.
141*37fc2fa1SThomas CortIf the shared file is not referenced by a full pathname,
142*37fc2fa1SThomas Cort.Xr cpp 1
143*37fc2fa1SThomas Cortsearches in the current (or home) directory first, and then in the
144*37fc2fa1SThomas Cortdirectory
145*37fc2fa1SThomas Cort.Pa /usr/share/calendar .
146*37fc2fa1SThomas CortEmpty lines and lines protected by the C commenting syntax
147*37fc2fa1SThomas Cort.Pq Li /* ... */
148*37fc2fa1SThomas Cortare ignored.
149*37fc2fa1SThomas Cort.Pp
150*37fc2fa1SThomas CortSome possible calendar entries:
151*37fc2fa1SThomas Cort.Bd -literal -offset indent
152*37fc2fa1SThomas Cort#include	\*[Lt]calendar.usholiday\*[Gt]
153*37fc2fa1SThomas Cort#include	\*[Lt]calendar.birthday\*[Gt]
154*37fc2fa1SThomas Cort
155*37fc2fa1SThomas Cort6/15		... June 15 (if ambiguous, will default to month/day).
156*37fc2fa1SThomas CortJun. 15		... June 15.
157*37fc2fa1SThomas Cort15 June		... June 15.
158*37fc2fa1SThomas CortThursday	... Every Thursday.
159*37fc2fa1SThomas CortJune		... Every June 1st.
160*37fc2fa1SThomas Cort15 *		... 15th of every month.
161*37fc2fa1SThomas Cort*15		... 15th of every month.
162*37fc2fa1SThomas CortJune*		... Every day of June.
163*37fc2fa1SThomas Cort**		... Every day
164*37fc2fa1SThomas Cort.Ed
165*37fc2fa1SThomas Cort.Sh FILES
166*37fc2fa1SThomas CortThe following default calendar files are provided:
167*37fc2fa1SThomas Cort.Pp
168*37fc2fa1SThomas Cort.Bl -tag -width calendar.christian -compact
169*37fc2fa1SThomas Cort.It Pa calendar.birthday
170*37fc2fa1SThomas CortBirths and deaths of famous (and not-so-famous) people.
171*37fc2fa1SThomas Cort.It Pa calendar.christian
172*37fc2fa1SThomas CortChristian holidays.
173*37fc2fa1SThomas CortThis calendar should be updated yearly by the local system administrator
174*37fc2fa1SThomas Cortso that roving holidays are set correctly for the current year.
175*37fc2fa1SThomas Cort.It Pa calendar.computer
176*37fc2fa1SThomas CortDays of special significance to computer people.
177*37fc2fa1SThomas Cort.It Pa calendar.history
178*37fc2fa1SThomas CortEverything else, mostly U.S. historical events.
179*37fc2fa1SThomas Cort.It Pa calendar.holiday
180*37fc2fa1SThomas CortOther holidays, including the not-well-known, obscure, and
181*37fc2fa1SThomas Cort.Em really
182*37fc2fa1SThomas Cortobscure.
183*37fc2fa1SThomas Cort.It Pa calendar.judaic
184*37fc2fa1SThomas CortJewish holidays.
185*37fc2fa1SThomas CortThis calendar should be updated yearly by the local system administrator
186*37fc2fa1SThomas Cortso that roving holidays are set correctly for the current year.
187*37fc2fa1SThomas Cort.It Pa calendar.lotr
188*37fc2fa1SThomas CortImportant dates in the Lord of the Rings series.
189*37fc2fa1SThomas Cort.It Pa calendar.music
190*37fc2fa1SThomas CortMusical events, births, and deaths.
191*37fc2fa1SThomas CortStrongly oriented toward rock 'n' roll.
192*37fc2fa1SThomas Cort.It Pa calendar.netbsd
193*37fc2fa1SThomas CortImportant dates in the history of the
194*37fc2fa1SThomas Cort.Nx
195*37fc2fa1SThomas Cortproject.
196*37fc2fa1SThomas CortMostly releases and port additions.
197*37fc2fa1SThomas Cort.It Pa calendar.usholiday
198*37fc2fa1SThomas CortU.S. holidays.
199*37fc2fa1SThomas CortThis calendar should be updated yearly by the local system administrator
200*37fc2fa1SThomas Cortso that roving holidays are set correctly for the current year.
201*37fc2fa1SThomas Cort.El
202*37fc2fa1SThomas Cort.Sh COMPATIBILITY
203*37fc2fa1SThomas CortThe
204*37fc2fa1SThomas Cort.Nm
205*37fc2fa1SThomas Cortprogram previously selected lines which had the correct date anywhere
206*37fc2fa1SThomas Cortin the line.
207*37fc2fa1SThomas CortThis is no longer true, the date is only recognized when it occurs
208*37fc2fa1SThomas Cortfirst on the line.
209*37fc2fa1SThomas Cort.Pp
210*37fc2fa1SThomas CortIn
211*37fc2fa1SThomas Cort.Nx 3.0 ,
212*37fc2fa1SThomas Cortthe
213*37fc2fa1SThomas Cort.Nm
214*37fc2fa1SThomas Cortcommand was modified to search the user's home directory instead of the current
215*37fc2fa1SThomas Cortdirectory by default.
216*37fc2fa1SThomas CortUsers desiring the historical behavior should set the
217*37fc2fa1SThomas Cort.Ev CALENDAR_DIR
218*37fc2fa1SThomas Cortenvironment variable to
219*37fc2fa1SThomas Cort.Pa \&. ,
220*37fc2fa1SThomas Cortor use the
221*37fc2fa1SThomas Cort.Fl f
222*37fc2fa1SThomas Cortflag.
223*37fc2fa1SThomas Cort.Sh SEE ALSO
224*37fc2fa1SThomas Cort.Xr at 1 ,
225*37fc2fa1SThomas Cort.Xr cpp 1 ,
226*37fc2fa1SThomas Cort.Xr cron 8
227*37fc2fa1SThomas Cort.Sh HISTORY
228*37fc2fa1SThomas CortA
229*37fc2fa1SThomas Cort.Nm
230*37fc2fa1SThomas Cortcommand appeared in
231*37fc2fa1SThomas Cort.At v7 .
232*37fc2fa1SThomas Cort.Sh BUGS
233*37fc2fa1SThomas Cort.Nm
234*37fc2fa1SThomas Cortdoesn't handle events that move around from year to year, i.e.,
235*37fc2fa1SThomas Cort.Dq the last Monday in April .
236*37fc2fa1SThomas Cort.Pp
237*37fc2fa1SThomas CortThe
238*37fc2fa1SThomas Cort.Fl a
239*37fc2fa1SThomas Cortoption ignores the user's
240*37fc2fa1SThomas Cort.Ev CALENDAR_DIR
241*37fc2fa1SThomas Cortenvironment variable.
242