xref: /netbsd-src/usr.bin/calendar/calendar.1 (revision 01869ca4d24a86379a68731bf9706a9f0820fe4e)
1*01869ca4Swiz.\"	$NetBSD: calendar.1,v 1.27 2017/07/03 21:34:18 wiz Exp $
2e9d0e83aSglass.\"
3e9d0e83aSglass.\" Copyright (c) 1989, 1990, 1993
4e9d0e83aSglass.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
30e9d0e83aSglass.\"     @(#)calendar.1	8.1 (Berkeley) 6/29/93
3161f28255Scgd.\"
321f657fa5Sagc.Dd June 1, 2016
3361f28255Scgd.Dt CALENDAR 1
3461f28255Scgd.Os
3561f28255Scgd.Sh NAME
3661f28255Scgd.Nm calendar
3761f28255Scgd.Nd reminder service
3861f28255Scgd.Sh SYNOPSIS
390b3de1caSlukem.Nm
401f657fa5Sagc.Op Fl avx
41c6dfed6dSwiz.Op Fl d Ar MMDD[[YY]YY]
42a73d0efdSthorpej.Op Fl f Ar file
43a73d0efdSthorpej.Op Fl l Ar days
44a73d0efdSthorpej.Op Fl w Ar days
4561f28255Scgd.Sh DESCRIPTION
46e9d0e83aSglassThe
470b3de1caSlukem.Nm
48a73d0efdSthorpejutility processes text files and displays lines that match certain dates.
4961f28255Scgd.Pp
5061f28255ScgdThe following options are available:
5161f28255Scgd.Bl -tag -width Ds
5261f28255Scgd.It Fl a
53c6dfed6dSwizProcess the
54c6dfed6dSwiz.Dq calendar
55c6dfed6dSwizfiles of all users and mail the results to them.
5661f28255ScgdThis requires super-user privileges.
57a73d0efdSthorpej.It Fl d Ar MMDD[[YY]YY]
58a6b397d6SsnjDisplay lines for the given date.
59a6b397d6SsnjBy default, the current date is used.
60a73d0efdSthorpejThe year, which may be given in either two or four digit format, is used
613f1d9ecdSrizonly for purposes of determining whether the given date falls on a Friday
62a6b397d6Ssnjin that year (see below).
63a6b397d6SsnjIf the year is not specified, the current year is assumed.
64a73d0efdSthorpej.It Fl f Ar file
6597205712SjwiseDisplay matching calendar files from the given filename.
6697205712SjwiseBy default, the following filenames are checked for:
67c6dfed6dSwiz.Bl -item -compact -offset indent
6897205712Sjwise.It
69fe72e405Sjwise.Pa ~/calendar
7097205712Sjwise.It
71fe72e405Sjwise.Pa ~/.calendar
7297205712Sjwise.It
7397205712Sjwise.Pa /etc/calendar
7497205712Sjwise.El
7597205712Sjwiseand the first which is found is used.
76a6b397d6SsnjThe filename may be absolute.
7792142a49SdhollandIf not absolute, it is taken relative to the
78a6b397d6Ssnjdirectory specified by the
79c6dfed6dSwiz.Ev CALENDAR_DIR
8092142a49Sdhollandenvironment variable, if set; otherwise, it is taken relative to the
8192142a49Sdhollanduser's home directory.
82a6b397d6SsnjOr, if the
83a73d0efdSthorpej.Fl a
84a73d0efdSthorpejflag is given, a non-absolute filename is taken relative to each user's
85a73d0efdSthorpejhome directory in turn.
86a73d0efdSthorpej.It Fl l Ar days
87c6dfed6dSwizCauses the program to
88c6dfed6dSwiz.Dq look ahead
89c6dfed6dSwiza given number of days (default one) from the specified date and
90c6dfed6dSwizdisplay their entries as well.
91a73d0efdSthorpej.It Fl w Ar days
92c6dfed6dSwizCauses the program to add the specified number of days to the
93c6dfed6dSwiz.Dq look ahead
94c6dfed6dSwiznumber if and only if the day specified is a Friday.
95a6b397d6SsnjThe default value is two, which causes
960b3de1caSlukem.Nm
97a73d0efdSthorpejto print entries through the weekend on Fridays.
981f657fa5Sagc.It Fl v
991f657fa5SagcCauses
1001f657fa5Sagc.Nm
1011f657fa5Sagcto print version information for itself,
1021f657fa5Sagcand then exit.
10369de851dSjwise.It Fl x
10469de851dSjwiseCauses
10569de851dSjwise.Nm
106c6dfed6dSwiznot to set the
107c6dfed6dSwiz.Ev CPP_RESTRICTED
108c6dfed6dSwizenvironment variable.
109c6dfed6dSwizPassing this flag allows users the (somewhat obscure) option of
110c6dfed6dSwizincluding a named pipe via
111c6dfed6dSwiz.Xr cpp 1 Ns No 's
112c6dfed6dSwiz.Li #include
11369de851dSjwisesyntax, but opens up the possibility of
11469de851dSjwise.Nm
115c6dfed6dSwizhanging indefinitely if users do so incorrectly.
116c6dfed6dSwizFor this reason, the
11769de851dSjwise.Fl x
11869de851dSjwiseflag should never be used with
11969de851dSjwise.Nm
12069de851dSjwise.Fl a .
12161f28255Scgd.El
12261f28255Scgd.Pp
123e9d0e83aSglassLines should begin with a month and day.
12461f28255ScgdThey may be entered in almost any format, either numeric or as character
12561f28255Scgdstrings.
126c6dfed6dSwizA single asterisk
127c6dfed6dSwiz.Pq Sq *
128b7ceeca8Swizmatches every month, or every day if a month has been provided.
129b7ceeca8SwizThis means that two asterisks
1304f1d9bdbSjwise.Pq Sq **
1314f1d9bdbSjwisematches every day of the year, and is thus useful for ToDo tasks.
13261f28255ScgdA day without a month matches that day of every week.
13361f28255ScgdA month without a day matches the first of that month.
13461f28255ScgdTwo numbers default to the month followed by the day.
13561f28255ScgdLines with leading tabs default to the last entered date, allowing
13661f28255Scgdmultiple line specifications for a single date.
137e9d0e83aSglassBy convention, dates followed by an asterisk are not fixed, i.e., change
13861f28255Scgdfrom year to year.
13961f28255Scgd.Pp
140c6dfed6dSwizThe
141c6dfed6dSwiz.Dq calendar
142c6dfed6dSwizfile is preprocessed by
14361f28255Scgd.Xr cpp 1 ,
14461f28255Scgdallowing the inclusion of shared files such as company holidays or
14561f28255Scgdmeetings.
14661f28255ScgdIf the shared file is not referenced by a full pathname,
14761f28255Scgd.Xr cpp 1
14861f28255Scgdsearches in the current (or home) directory first, and then in the
14961f28255Scgddirectory
15061f28255Scgd.Pa /usr/share/calendar .
15161f28255ScgdEmpty lines and lines protected by the C commenting syntax
15261f28255Scgd.Pq Li /* ... */
15361f28255Scgdare ignored.
15461f28255Scgd.Pp
15561f28255ScgdSome possible calendar entries:
156972bdd86Swiz.Bd -literal -offset indent
157*01869ca4Swiz#include	<calendar.usholiday>
158*01869ca4Swiz#include	<calendar.birthday>
15961f28255Scgd
16061f28255Scgd6/15		... June 15 (if ambiguous, will default to month/day).
16161f28255ScgdJun. 15		... June 15.
16261f28255Scgd15 June		... June 15.
16361f28255ScgdThursday	... Every Thursday.
16461f28255ScgdJune		... Every June 1st.
16561f28255Scgd15 *		... 15th of every month.
1664f1d9bdbSjwise*15		... 15th of every month.
1674f1d9bdbSjwiseJune*		... Every day of June.
1684f1d9bdbSjwise**		... Every day
16961f28255Scgd.Ed
17061f28255Scgd.Sh FILES
17161f28255ScgdThe following default calendar files are provided:
17261f28255Scgd.Pp
17361f28255Scgd.Bl -tag -width calendar.christian -compact
17461f28255Scgd.It Pa calendar.birthday
17561f28255ScgdBirths and deaths of famous (and not-so-famous) people.
17661f28255Scgd.It Pa calendar.christian
17761f28255ScgdChristian holidays.
17861f28255ScgdThis calendar should be updated yearly by the local system administrator
17961f28255Scgdso that roving holidays are set correctly for the current year.
18061f28255Scgd.It Pa calendar.computer
18161f28255ScgdDays of special significance to computer people.
18261f28255Scgd.It Pa calendar.history
18361f28255ScgdEverything else, mostly U.S. historical events.
18461f28255Scgd.It Pa calendar.holiday
18561f28255ScgdOther holidays, including the not-well-known, obscure, and
18661f28255Scgd.Em really
18761f28255Scgdobscure.
18861f28255Scgd.It Pa calendar.judaic
18961f28255ScgdJewish holidays.
19061f28255ScgdThis calendar should be updated yearly by the local system administrator
19161f28255Scgdso that roving holidays are set correctly for the current year.
192a6b397d6Ssnj.It Pa calendar.lotr
193a6b397d6SsnjImportant dates in the Lord of the Rings series.
19461f28255Scgd.It Pa calendar.music
19561f28255ScgdMusical events, births, and deaths.
19661f28255ScgdStrongly oriented toward rock 'n' roll.
197a6b397d6Ssnj.It Pa calendar.netbsd
198a6b397d6SsnjImportant dates in the history of the
199a6b397d6Ssnj.Nx
200a6b397d6Ssnjproject.
201a6b397d6SsnjMostly releases and port additions.
20261f28255Scgd.It Pa calendar.usholiday
20361f28255ScgdU.S. holidays.
20461f28255ScgdThis calendar should be updated yearly by the local system administrator
20561f28255Scgdso that roving holidays are set correctly for the current year.
20661f28255Scgd.El
20761f28255Scgd.Sh COMPATIBILITY
20861f28255ScgdThe
2090b3de1caSlukem.Nm
21061f28255Scgdprogram previously selected lines which had the correct date anywhere
21161f28255Scgdin the line.
21261f28255ScgdThis is no longer true, the date is only recognized when it occurs
21361f28255Scgdfirst on the line.
214fe72e405Sjwise.Pp
215fe72e405SjwiseIn
216fe72e405Sjwise.Nx 3.0 ,
217fe72e405Sjwisethe
218fe72e405Sjwise.Nm
219fe72e405Sjwisecommand was modified to search the user's home directory instead of the current
22068f70942Swizdirectory by default.
22168f70942SwizUsers desiring the historical behavior should set the
222fe72e405Sjwise.Ev CALENDAR_DIR
223fe72e405Sjwiseenvironment variable to
224fe72e405Sjwise.Pa \&. ,
225fe72e405Sjwiseor use the
226fe72e405Sjwise.Fl f
227fe72e405Sjwiseflag.
22880ab18e8Sjoerg.Sh SEE ALSO
22980ab18e8Sjoerg.Xr at 1 ,
23080ab18e8Sjoerg.Xr cpp 1 ,
23180ab18e8Sjoerg.Xr cron 8
23261f28255Scgd.Sh HISTORY
23361f28255ScgdA
23461f28255Scgd.Nm
235b79c476dSjtccommand appeared in
236b79c476dSjtc.At v7 .
23761f28255Scgd.Sh BUGS
2380b3de1caSlukem.Nm
239e9d0e83aSglassdoesn't handle events that move around from year to year, i.e.,
240c6dfed6dSwiz.Dq the last Monday in April .
24153175f50Schristos.Pp
24253175f50SchristosThe
24353175f50Schristos.Fl a
24453175f50Schristosoption ignores the user's
24553175f50Schristos.Ev CALENDAR_DIR
24653175f50Schristosenvironment variable.
247