home *** CD-ROM | disk | FTP | other *** search
- From: dfs@doe.carleton.ca (David F. Skoll)
- Newsgroups: alt.sources
- Subject: REMIND 2.0 03/03
- Message-ID: <dfs.657486297@yar>
- Date: 1 Nov 90 19:04:57 GMT
-
- ------------- CUT HERE ---
- #!/bin/sh
- # This is part 03 of Remind 2.0
- if touch 2>&1 | fgrep 'amc' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- # ============= remind.1 ==============
- if test X"$1" != X"-c" -a -f 'remind.1'; then
- echo "File already exists: skipping 'remind.1'"
- else
- sed 's/^X//' << 'SHAR_EOF' > remind.1 &&
- X.TH REMIND 1 "25 October 1990"
- X.UC 4
- X.SH NAME
- Xremind \- a sophisticated reminder service
- X.SH SYNOPSIS
- X.B remind
- X[
- X.B \-dvrop
- X]
- X.I filename
- X[
- X.I date
- X]
- X.SH DESCRIPTION
- X.B remind
- Xreads the supplied
- X.I filename
- Xfor a list of reminders, and then issues reminders appropriate for
- Xthe current date.
- XEach reminder can consist of a message sent to standard output, or
- Xa program to be executed.
- X.SH OPTIONS
- X.TP
- X.B \-d
- XThe
- X.B \-d
- Xflag causes
- X.B remind
- Xto enter a debugging mode.
- XIn this mode, each reminder in the reminder file is examined and its
- Xtrigger date is printed to standard output. Also, some consistency
- Xchecking is done, and warnings are issued about constructs which could
- Xresult in slow execution times.
- X.TP
- X.B \-v
- XThe
- X.B \-v
- Xflag causes the debugging messages caused by
- X.B \-d
- Xto be printed in a verbose manner. Also, any error messages issued by
- X.B remind
- Xare printed in verbose format.
- X.TP
- X.B \-r
- XThe
- X.B \-r
- Xflag causes
- X.B remind
- Xto ignore any
- X.B RUN
- Xdirectives in the reminder file.
- X.TP
- X.B \-o
- XThe
- X.B \-o
- Xflag causes
- X.B remind
- Xto ignore any
- X.B ONCE
- Xdirectives in the reminder file.
- X.TP
- X.B \-p
- XThe
- X.B \-p
- Xflag causes
- X.B remind
- Xto go into
- X.I purge
- Xmode. This mode is incompatible with the
- X.B \-d
- Xflag. It causes
- X.B remind
- Xto scan the reminder file and echo all reminders which have not expired
- Xto the standard output. All expired reminders are echoed to the standard
- Xerror stream.
- X.PP
- XIf you supply a
- X.I date
- Xon the command line, it must consist of
- X.I day month year
- Xwhere
- X.I day
- Xis the day of the month,
- X.I month
- Xis (at least the first three letters of) the English name of the month,
- Xand
- X.I year
- Xis a year (all 4 digits) from 1990 to 2075. These components can appear
- Xin any order, but must be separated by spaces. If a date is supplied,
- X.B remind
- Xuses it rather than the actual system date as its notion of "today." You
- Xcan use this feature to test how reminders will appear in the future.
- X.SH REMINDER FILES
- X.B Remind
- Xuses scripts called
- X.I reminder files
- Xto control its operation. A sample reminder file is shown below:
- X.PP
- X.nf
- X #!/usr/local/bin/remind
- X # Sample file
- X BANNER Hi there. Here are your reminders:
- X
- X # First some birthdays
- X REM 6 Jan MSG David's birthday.
- X REM 23 Nov +10 MSG El's birthday is %a.
- X
- X # Next some housekeeping
- X REM 1 -1 OMIT Sat Sun RUN do_backup
- X
- X # Introduce some holidays
- X OMIT 25 Dec # Christmas
- X OMIT 1 July # Canada Day
- X OMIT 22 Nov 1990 # American Thanksgiving
- X
- X # Business things
- X REM 23 Nov 1990 +2 MSG Meeting with Bill at 10am %a.
- X.fi
- X.PP
- XNote that
- X.B remind
- Xignores blank lines and lines beginning with "#".
- XAlso, commands, names of months, etc. can be typed in any
- Xmixture of upper- and lower-case. The convention I use is to
- Xuse upper-case for
- X.B remind
- Xtokens like
- X.I
- XMSG, OMIT,
- Xetc., and mixed case for other words like
- X.I January
- Xand
- X.I Sunday.
- X.SH THE REM COMMAND
- XThe most-used command in a reminder file is the
- X.I REM
- Xcommand. This command is used to denote a reminder. There are two
- Xforms of the
- X.I REM
- Xcommand; they are:
- X.RS
- XREM [ONCE]
- X[
- X.I date_spec
- X]
- X[
- X.I delta
- X]
- X[
- X.I back
- X]
- X[
- XOMIT
- X.I omit_list
- X]
- XMSG
- X.I body
- X.PP
- XREM [ONCE]
- X[
- X.I date_spec
- X]
- X[
- X.I delta
- X]
- X[
- X.I back
- X]
- X[
- XOMIT
- X.I omit_list
- X]
- XRUN
- X.I body
- X.RE
- XThe
- X.I date_spec, delta
- Xand
- X.I back
- Xcan be specified in any order. The
- X.I OMIT,
- Xif present, must follow these three
- Xitems. The
- X.I MSG
- Xor
- X.I RUN
- Xmust be the last item before the
- X.I body.
- X.PP
- X.B Date Specifications
- X.PP
- XThe
- X.I date_spec
- Xconsists of zero to four parts. These parts are
- X.I day
- X(day of month),
- X.I month
- X(month name),
- X.I year
- Xand
- X.I weekday.
- X.I Month
- Xand
- X.I weekday
- Xare the English names of months and weekdays. At least the first three
- Xcharacters must be used. Case is irrelevant. The following are examples
- Xof the various parts of a
- X.I date_spec:
- X.TP
- X.I day:
- X1, 22, 31, 14, 3
- X.TP
- X.I month:
- XJANUARY, feb, March, ApR, may, Aug
- X.TP
- X.I year:
- X1990, 1993, 2030, 95 (interpreted as 1995). The year can range
- Xfrom 1990 to 2075.
- X.TP
- X.I weekday:
- XMonday, tue, Wed, THU, Friday, saturday, sundAy
- X.PP
- XNote that there can be several
- X.I weekday
- Xcomponents separated by spaces in a
- X.I date_spec.
- X.PP
- X.B Interpretation of Date Specifications
- X.PP
- XThe following examples show how date specifications are interpreted.
- X.PP
- X1. Null date specification - the reminder is triggered every day.
- XThe trigger date for a specific run is simply the current system date.
- X.PP
- X2. Only
- X.I day
- Xpresent. The reminder is triggered on the specified day of each month.
- XThe trigger date for a particular run is the closest such day to the
- Xcurrent system date. For example:
- X.nf
- X REM 1 MSG First of every month.
- X REM 31 MSG 31st of every month that has 31 days.
- X.fi
- X.PP
- X3. Only
- X.I month
- Xpresent. The reminder is triggered every day of the specified month.
- XExample:
- X.nf
- X REM Feb MSG Every day in February
- X.fi
- X.PP
- X4.
- X.I day
- Xand
- X.I month
- Xpresent. Examples:
- X.nf
- X REM 6 Jan MSG Every 6th of January
- X REM Feb 29 MSG Every 29th of February
- X.fi
- X.PP
- X5. Only
- X.I year
- Xpresent. Example:
- X.nf
- X REM 1991 MSG Every day in 1991
- X.fi
- X.PP
- X6.
- X.I year
- Xand
- X.I day
- Xpresent. Examples:
- X.nf
- X REM 1 1990 MSG 1st of every month in 1990
- X REM 1992 23 MSG 23rd of every month in 1992
- X.fi
- X.PP
- X7.
- X.I year
- Xand
- X.I month
- Xpresent. Examples:
- X.nf
- X REM Feb 1991 MSG Every day in Feb 1991
- X REM 1992 September MSG Every day in Sept 1992
- X.fi
- X.PP
- X8.
- X.I year, month
- Xand
- X.I day
- Xpresent. Examples:
- X.nf
- X REM 8 Jan 1991 MSG 8th January 1991.
- X REM 1992 March 9 MSG 9th March 1992.
- X.fi
- X.PP
- X9.
- X.I weekday
- Xonly. Examples:
- X.nf
- X REM Sat MSG Every Saturday
- X REM Mon Tue Wed Thu Fri MSG Every working day
- X REM Monday Wednesday MSG Every Monday and Wednesday
- X.fi
- X.PP
- X10.
- X.I weekday
- Xand
- X.I day
- Xpresent. Examples:
- X.nf
- X REM Sat 1 MSG First Saturday of every month
- X REM Mon Tue Wed Thu Fri MSG 1st working day after 15th of every month
- X.fi
- X.PP
- X11.
- X.I weekday
- Xand
- X.I month
- Xpresent. Examples:
- X.nf
- X REM Mon March MSG Every Monday in March
- X REM Mon Tue Wed Thu Fri Feb MSG Every working day in February
- X.fi
- X.PP
- X12.
- X.I weekday, month
- Xand
- X.I day
- Xpresent. Examples:
- X.nf
- X REM Mon 1 March MSG First Monday in March
- X REM Sat Sun 15 July MSG First Sat or Sun on or after 15 July
- X.fi
- X.PP
- X13.
- X.I weekday
- Xand
- X.I year
- Xpresent. Example:
- X.nf
- X REM Sat Sun 1991 MSG Every Saturday and Sunday in 1991
- X.fi
- X.PP
- X14.
- X.I weekday, day
- Xand
- X.I year
- Xpresent. Examples:
- X.nf
- X REM Mon 15 1990 MSG 1st Mon after 15th of every month in 1990
- X REM Mon Tue Wed Thu Fri 1 1990 MSG 1st working day of every
- X month in 1990
- X.fi
- X.PP
- X15.
- X.I weekday, month
- Xand
- X.I year
- Xpresent. Example:
- X.nf
- X REM Mon Wed 1991 Feb MSG Every Mon and Wed in Feb 1991.
- X.fi
- X.PP
- X16.
- X.I weekday, day, month
- Xand
- X.I year
- Xpresent. Example:
- X.nf
- X REM Mon Tue Wed Thu Fri 28 Oct 1990 MSG 1st working day
- X on or after 28 October 1990.
- X.fi
- X.PP
- XNote that when
- X.I weekday
- Xand
- X.I day
- Xare specified,
- X.B remind
- Xchooses the first date on or after the specified
- X.I day
- Xwhich also satisfies the
- X.I weekday
- Xconstraint. It does this by picking the first date on or after the specified
- X.I day
- Xwhich is listed in the list of
- X.I weekdays.
- XThus, a reminder like:
- X.PP
- X.nf
- X REM Mon Tue 28 Oct 1990 MSG Hi
- X.fi
- X.PP
- Xwould be issued only on Monday, 29 October, 1990. It would not be issued
- Xon Tuesday, 30 October, 1990, since the 29th is the first date to satisfy
- Xthe
- X.I weekday
- Xconstraints.
- X.PP
- X.B Backward Scanning
- X.PP
- XSometimes, you need to incorporate "backward scanning" into your date
- Xspecification. This is accomplished with the
- X.I back
- Xpart of the reminder specification. If present, the
- X.I back
- Xis specified as a negative number. This causes
- X.B remind
- Xto compute the trigger date as usual, and then move back the specified
- Xnumber of days. For example:
- X.PP
- X.nf
- X REM Mon 1 -7 MSG Last Monday of every month.
- X.fi
- X.PP
- XThis works by finding the first Monday of every month, and then moving
- X"back" seven days. This results in the last Monday of the previous
- Xmonth. (Warning: If you have global
- X.I OMITs,
- Xthis might not work - see
- Xthe
- X.I OMIT
- Xcommand.)
- X.PP
- XAnother example is:
- X.PP
- X.nf
- X REM 1 -1 MSG Last day of every month.
- X.fi
- X.PP
- XSince we don't know how many days are in a month, to get to the last day
- Xof a month, we go to the first day of the next month and then move back
- Xone day.
- X.PP
- X.B Remind
- Xwill automatically scan forwards and backwards until it finds a suitable
- Xtrigger date. Note that large
- X.I back
- Xvalues can lead to a lot of backtracking and slow the execution of
- X.B remind.
- X.PP
- X.B Advance Warning
- X.PP
- X.B Remind
- Xcan warn you of an upcoming reminder as far in advance as you desire. This
- Xis specified by a
- X.I delta,
- Xwhich is a positive number preceded by a "+" sign. For example:
- X.PP
- X.nf
- X REM 8 Jan 1992 +3 MSG Test1
- X REM 1 +1 MSG Test2
- X.fi
- X.PP
- XThe reminder "Test1" will be triggered on the 8th of January, 1992, as well
- Xas the 3 days preceding it. All told, "Test1" will be triggered on the
- X5th through the 8th of January, 1992.
- X.PP
- XThe reminder "Test2" will be triggered on the first day of every month, as
- Xwell as the day before. In effect, "Test2" will be triggered on the first
- Xand last day of every month.
- X.PP
- X.I Delta
- Xand
- X.I back
- Xcan be combined:
- X.PP
- X.nf
- X REM Mon 1 -7 +3 MSG Test3
- X.fi
- X.PP
- XThe reminder "Test3" will be triggered on the last Monday of every month,
- Xas well as the three days preceding it.
- X.PP
- X.B The MSG Keyword
- X.PP
- XThe
- X.I MSG
- Xkeyword causes the remaining part of the line to be passed through a
- Xsubstitution filter and then printed to standard output whenever the
- Xreminder is triggered. See the section "Substitution" for more information
- Xabout the substitution filter.
- X.PP
- X.B The RUN Keyword
- X.PP
- XThe
- X.I RUN
- Xkeyword causes the remaining part of the line to be passed through the
- Xsubstitution filter and then passed to the default shell for execution
- Xwhenever the reminder is triggered. If the
- X.B \-r
- Xcommand-line option is specified, all
- X.I REM
- Xcommands with the
- X.I RUN
- Xkeyword are ignored.
- X.PP
- X.B
- XGetting Reminded only Once per Day
- X.PP
- XIf you run
- X.B remind
- Xfrom your
- X.I .login
- Xscript, you may only want certain reminders to be run once per day, not
- Xonce per login. Typically, this is used to control
- X.I RUN
- Xcommands so that they only execute once per day. To specify this,
- Xplace the
- X.I ONCE
- Xkeyword in the reminder file. When
- X.B remind
- Xencounters a
- X.I ONCE
- Xkeyword, it checks the last-access date of the reminder file. If it is
- Xequal to the current date,
- X.B remind
- Xassumes that the reminder file has already been run once, and ignored the
- Xreminder. If you start
- X.B remind
- Xwith the
- X.B \-o
- Xcommand-line option,
- X.B remind
- Xignores the
- X.I ONCE
- Xkeyword.
- X.PP
- X.B
- XLocally Omitting Weekdays
- X.PP
- XA
- X.I REM
- Xcommand containing the
- X.I OMIT
- Xkeyword followed by a list of weekdays causes the
- X.I delta
- Xand
- X.I back
- Xto ignore the specified weekdays when counting days. This is called a
- X.I local OMIT.
- XFor example:
- X.PP
- X.nf
- X REM 1 +1 OMIT Sat Sun MSG Test4
- X.fi
- X.PP
- XThis reminder prints "Test4" on the first day of every month, as well
- Xas the previous day. If, however, the first day of the month falls on
- Xa Sunday or Monday, the reminder is also triggered on the previous
- XFriday, since the
- X.I delta
- Xof +1 does not count Saturdays or Sundays when moving backwards. Here's
- Xanother example:
- X.PP
- X.nf
- X REM 1 -1 +1 OMIT Sat Sun MSG Test5
- X.fi
- X.PP
- XThis reminder is triggered on the last working day of each month, as well
- Xas the working day preceding it. Let's look at it in detail:
- X.PP
- XThe
- X.I day
- Xof "1" specifies the first day of each month. The
- X.I back
- Xof "-1" tells
- X.B remind
- Xto go backwards by one day, not counting Saturday and Sunday as it moves.
- XThis takes us the the last working day of the preceding month, which is the
- Xtrigger date. The
- X.I delta
- Xof "+1" ensures that the reminder will be triggered on the day preceding
- Xthis trigger date also. Finally, if the trigger date happens to be
- Xa Monday, the
- X.I delta
- Xcombined with the
- X.I local OMIT
- Xcauses the reminder to be triggered on the Friday (and Saturday and Sunday)
- Xpreceding the trigger date.
- X.SH THE OMIT COMMAND
- X.I OMIT
- Xexists as a separate command as well as a keyword within a
- X.I REM
- Xstatement. When used as a separate command, it is called a
- X.I global OMIT,
- Xand has the following form:
- X.RS
- XOMIT
- X.I day
- X.I month
- X[
- X.I year
- X]
- X.RE
- XThe arguments can be specified in any order.
- X.PP
- XThe form without the
- X.I year
- Xcomponent is used for holidays which fall on the same date each year.
- XFor example:
- X.PP
- X.nf
- X OMIT 25 December # Christmas
- X OMIT 1 January # New Year's Day
- X.fi
- X.PP
- X(Note that
- X.I OMIT
- Xcan have a following comment on the same line, unlike the
- X.I REM
- Xcommand.)
- X.PP
- XThe form with the
- X.I year
- Xcomponent is used for holidays which vary from year to year. For example:
- X.PP
- X.nf
- X OMIT 12 October 1990 # Columbus Day 1990
- X OMIT 22 November 1990 # Thanksgiving Day 1990
- X.fi
- X.PP
- XIn its debugging messages,
- X.B remind
- Xcalls the first form a
- X.I partially-specified global OMIT
- Xand the second form a
- X.I fully-specified global OMIT.
- X.PP
- XThe dates specified by
- X.I global OMITs
- Xare omitted by the
- X.I back
- Xand
- X.I delta
- Xportions of a reminders, in addition to any
- X.I local OMITs.
- XFor example:
- X.PP
- X.nf
- X OMIT 25 December
- X REM 26 +1 OMIT Sat Sun MSG Test6
- X.fi
- X.PP
- XThis would issue a reminder on the 26th of each month, as well as the
- Xpreceding working day. Also, on the 24th of December 1990, the reminder
- Xwould be issued. Even though the 25th of December 1990 is a Tuesday, the
- X.I global OMIT
- Xwould cause the
- X.I delta
- Xto skip it.
- X.PP
- X.I Global OMITs
- Xare in force for all reminders following them in the reminder file. Thus,
- Xyou could have a series of reminders for which
- X.I global OMITs
- Xare inappropriate (such as birthdays or reminders which rely on
- X.I back
- Xto get to a specific weekday) ahead of any
- X.I global OMITs,
- Xwith business reminders (for which omission of holidays is appropriate)
- Xfollowing the
- X.I global OMITs.
- X.SH THE INCLUDE COMMAND
- XThe
- X.I INCLUDE
- Xcommand has the following form:
- X.RS
- XINCLUDE
- X.I filename
- X.RE
- XThis causes
- X.B remind
- Xto suspend the current file and read the contents of the specified
- X.I filename.
- XOnce that file has been read,
- X.B remind
- Xcontinues reading the original file from where it left off.
- X.I INCLUDE
- Xcommands can be nested to a depth of 10.
- X.PP
- X.I INCLUDE
- Xallows you or someone else to maintain a file of holidays or system-wide
- Xreminders that everyone should get. For example, your reminder file could
- Xlook something like this:
- X.PP
- X.nf
- X #!/usr/local/bin/remind
- X #
- X # Place personal stuff here - birthdays, etc.
- X
- X # Now get system-wide global OMITS (holidays)
- X INCLUDE /usr/share/holidays
- X
- X # and system-wide reminders
- X INCLUDE /usr/share/reminders
- X
- X # Place local business stuff here.
- X.fi
- X.PP
- XThe
- X.I ONCE
- Xkeyword operates on the last-access date of the top-level file.
- XThe access dates of
- X.I INCLUDEd
- Xfiles are not used to control the operation of the
- X.I ONCE
- Xkeyword.
- X.SH SUBSTITUTION
- XBefore being processed, the body of a
- X.I REM
- Xcommand is passed through a substitution filter. The filter scans for
- Xsequences "%x" where "x" is any letter, and performs substitutions as
- Xshown below. (All dates refer to the trigger date of the reminder.)
- X.TP
- X.B %a
- Xis replaced with "on \fIweekday, day month, year\fR"
- X.RS
- XFor example, consider the reminder:
- X.PP
- XREM 18 Oct 1990 +4 MSG Meeting with Bob %a.
- X.PP
- XOn 16 October 1990, it would print "Meeting with Bob on Thursday, 18 October,
- X1990."
- X.PP
- XOn 17 October 1990, it would print "Meeting with Bob tomorrow."
- X.PP
- XOn 18 October 1990, it would print "Meeting with Bob today."
- X.RE
- X.TP
- X.B %b
- Xis replaced with "in \fIdiff\fR day's time" where
- X.I diff
- Xis the
- X.B actual
- Xnumber of days between the current date and the trigger date.
- X(\fIOMITs\fR have no effect.)
- X.RS
- XFor example, consider:
- X.PP
- XREM 18 Oct 1990 +4 MSG Meeting with Bob %b.
- X.PP
- XOn 16 October 1990, it would print "Meeting with Bob in 2 days' time."
- X.PP
- XOn 17 October 1990, it would print "Meeting with Bob tomorrow."
- X.PP
- XOn 18 October 1990, it would print "Meeting with Bob today."
- X.RE
- X.TP
- X.B %c
- Xis replaced with "on \fIweekday\fR"
- X.RS
- XExample: REM 18 Oct 1990 +4 MSG Meeting with Bob %c.
- X.PP
- XOn 16 October 1990, it would print "Meeting with Bob on Thursday."
- X.PP
- XOn 17 October 1990, it would print "Meeting with Bob tomorrow."
- X.PP
- XOn 18 October 1990, it would print "Meeting with Bob today."
- X.RE
- X.TP
- X.B %d
- Xis replaced with "\fIday\fR", the day of the month.
- X.TP
- X.B %e
- Xis replaced with "on \fIdd/mm/yyyy\fR"
- X.TP
- X.B %f
- Xis replaced with "on \fImm/dd/yyyy\fR"
- X.TP
- X.B %g
- Xis replaced with "on \fIweekday, day month\fR"
- X.TP
- X.B %h
- Xis replaced with "on \fIdd/mm\fR"
- X.TP
- X.B %i
- Xis replaced with "on \fImm/dd\fR"
- X.TP
- X.B %j
- Xis replaced with "on \fIweekday, month day-th, year\fR" This form appends the
- Xcharacters "st", "nd", "rd" or "th" to the day of the month, as appropriate.
- X.TP
- X.B %k
- Xis replaced with "on \fIweekday, month day-th\fR"
- X.TP
- X.B %l
- Xis replaced with "on \fIyyyy/mm/dd\fR"
- X.TP
- X.B %m
- Xis replaced with "\fImonth\fR", the name of the month.
- X.TP
- X.B %n
- Xis replaced with the number (1 to 12) of the month.
- X.TP
- X.B %o
- Xis replaced with " (today)" if and only if the current system date is the same
- Xas the date being used by
- X.B remind
- Xas the current date. Recall that you can specify a date for
- X.B remind
- Xto use on the command line. This substitution is not generally useful in a
- X.I REM
- Xcommand, but is useful in a
- X.I BANNER
- Xstatement. (See the section "The BANNER Command.)
- X.TP
- X.B %p
- Xis replaced with "s" if the
- X.I diff
- Xbetween the current date and the trigger date is not 1. You can use this
- Xto construct reminders like:
- X.RS
- XREM 1 Jan +4 MSG %x day%p to go before New Year!
- X.RE
- X.TP
- X.B %q
- Xis replaced with "'s" if the
- X.I diff
- Xbetween the trigger date and the current date is 1. Otherwise, it is replaced
- Xwith "s'" This can be used as follows:
- X.RS
- XREM 1 Jan +4 MSG New Year in %x day%q time!
- X.RE
- X.TP
- X.B %r
- Xis replaced with the day of the month (01 to 31) padded with a leading zero
- Xif needed to pad to two digits.
- X.TP
- X.B %s
- Xis replaced with "st", "nd", "rd" or "th" depending on the day of the month.
- X.TP
- X.B %t
- Xis replaced with the number of the month (01 to 12) padded to two digits
- Xwith a leading zero.
- X.TP
- X.B %u
- Xis replaced with "on \fIweekday, day-th month, year\fR" This is similar
- Xto
- X.B %a
- Xexcept that "st", "nd", "rd" or "th" is added to the
- X.I day
- Xas appropriate.
- X.TP
- X.B %v
- Xis replaced with "on \fIweekday, day-th month\fR"
- X.TP
- X.B %w
- Xis replaced with "\fIweekday\fR", the name of the day of the week.
- X.TP
- X.B %x
- Xis replaced with the
- X.I diff
- Xbetween the current date and the trigger date. The
- X.I diff
- Xis defined as the actual number of days between these two dates;
- X.I OMITs
- Xare not counted. (Strict date subtraction is performed.)
- X.TP
- X.B %y
- Xis replaced with "\fIyear\fR", the year of the trigger date.
- X.TP
- X.B %z
- Xis replaced with "\fIyy\fR", the last two digits of the year.
- X.PP
- XNotes:
- X.TP
- X o
- XSubstitutions a, b, c, e, f, g, h, i, j, k, l, u and v all are replaced
- Xwith "today" if the current date equals the trigger date, or "tomorrow"
- Xif the trigger date is one day after the current date. Thus, they are
- X.B not
- Xthe same as substitutions built up from the simpler %w, %y, etc.
- Xsequences.
- X.TP
- Xo
- XCapital letters can be used in the substitution sequence, in which case
- Xthe first character of the substituted string is capitalized (if it is
- Xnormally a lower-case letter.)
- X.TP
- Xo
- XAll other characters following a "%" sign are simply copied. In particular,
- Xto get a "%" sign out, use "%%" in the body. To start the body of a reminder
- Xwith a space, use "% ", since
- X.B remind
- Xnormally scans for the first non-space character after a
- X.I MSG
- Xor
- X.I RUN
- Xtoken.
- X.PP
- X.B
- XMulti-line Reminders
- X.PP
- X.B Remind
- Xis a line-oriented program. Normally, a blank line is printed between
- Xreminders. You can "fake" a multi-line reminder by repeating single-line
- Xreminders, ending all but the last with "%". The final "%" causes
- X.B remind
- Xnot to print a blank line after the reminder. (Don't type any spaces after
- Xthe final "%") Thus:
- X.PP
- X.nf
- X REM 25 July +2 MSG This is an example of a%
- X REM 25 July +2 MSG long reminder that takes up%
- X REM 25 July +2 MSG three lines.
- X.fi
- X.SH THE BANNER COMMAND
- XWhen
- X.B remind
- Xissues reminders, it normally prints a message saying:
- X.PP
- X"Reminders for \fIweekday, day-th month, year\fR (today):"
- X.PP
- X(If you supply a date on the command line different from the system date,
- Xthe "(today)" portion is omitted.)
- X.PP
- XYou can change this default to anything you want with the
- X.I BANNER
- Xcommand. It should appear in the reminder file before any
- X.I REM
- Xcommands. (This is not enforced, but a
- X.I BANNER
- Xcommand encountered after a reminder has been triggered will be ignored.)
- X.PP
- XThe format of
- X.I BANNER
- Xis:
- X.PP
- XBANNER
- X.I string
- X.PP
- XThe
- X.I string
- Xis passed through the substitution mechanism described before, using the
- Xcurrent date for substitution. The standard banner is described by:
- X.PP
- X.nf
- X BANNER Reminders for %w, %d%s %m, %y%o:
- X.fi
- X.PP
- XYou can have a blank banner by using:
- X.PP
- X.nf
- X BANNER %
- X.fi
- X.PP
- X.SH PURGING REMINDER FILES
- XYou should periodically purge your reminder file of "expired"
- X.I REM
- Xcommands and global
- X.I OMITs.
- XThese are reminders which took place in the past and can never occur
- Xagain, or
- X.I OMITs
- Xwhich are for past years. Of course, only
- X.I REMs
- Xand
- X.I OMITs
- Xwith the
- X.I year
- Xspecified can ever expire.
- X.PP
- XTo purge your reminder file, run
- X.B remind
- Xin
- X.I purge
- Xmode. This mode simply echoes non-expired lines to standard output, and
- Xexpired lines to standard error. Thus, to purge a file, you could type:
- X.PP
- X.nf
- X REMIND -p notes.old > notes.new
- X.fi
- X.PP
- XThe file "notes.new" would contain all non-expired lines from "notes.old."
- XAll expired lines are echoed to the screen.
- X.I INCLUDEd
- Xfiles are read an processed, but not purged. You must purge each
- X.I INCLUDEd
- Xfile separately.
- X.PP
- XYou can supply a date on the command line when purging, but beware: If you
- Xsupply a date in the future, you may inadvertently purge lines which have not
- Xreally expired yet.
- X.SH DEBUGGING A REMINDER FILE
- XThe debug command-line option \-d is used to debug reminder files. It tells
- Xyou useful information about the reminder file. It displays the trigger date
- Xof each reminder, and places an asterisk by those which would be issued
- Xon the current date. It also informs you of
- X.I OMITs
- Xwhich have expired, and gives warnings about situations which could lead
- Xto long execution times or unexpected results.
- X.PP
- XAll debugging messages are sent to standard error.
- X.SH AUTHOR
- XDavid F. Skoll
- X.SH BUGS
- X.B Remind
- Xwas originally written for MS-DOS and ported to UNIX. It does some things
- Xin an ungainly way.
- X.PP
- XMulti-line reminders are a kludge.
- X.PP
- XDate calculation algorithms are fairly "brute force."
- X
- SHAR_EOF
- $TOUCH -am 1101132790 remind.1 &&
- chmod 0600 remind.1 ||
- echo "restore of remind.1 failed"
- set `wc -c remind.1`;Wc_c=$1
- if test "$Wc_c" != "22384"; then
- echo original size 22384, current size $Wc_c
- fi
- fi
- # ============= remind.mak ==============
- if test X"$1" != X"-c" -a -f 'remind.mak'; then
- echo "File already exists: skipping 'remind.mak'"
- else
- sed 's/^X//' << 'SHAR_EOF' > remind.mak &&
- X# Simple-minded MAKE file.
- X
- XHEADERS = globals.h protos.h defines.h
- XWARN = /W3
- Xmain.obj: main.c $(HEADERS)
- X cl $(WARN) /AS /Fomain.obj /c main.c
- X
- Xnextdate.obj: nextdate.c $(HEADERS)
- X cl $(WARN) /AS /Fonextdate.obj /c nextdate.c
- X
- Xdorem.obj: dorem.c $(HEADERS)
- X cl $(WARN) /AS /Fodorem.obj /c dorem.c
- X
- Xinit.obj: init.c $(HEADERS)
- X cl $(WARN) /AS /Foinit.obj /c init.c
- X
- Xdosubst.obj: dosubst.c
- X cl $(WARN) /AS /Fodosubst.obj /c dosubst.c
- X
- Xfiles.obj: files.c
- X cl $(WARN) /AS /Fofiles.obj /c files.c
- X
- Xremind.exe: main.obj nextdate.obj dorem.obj init.obj dosubst.obj files.obj
- X cl /Feremind.exe main.obj nextdate.obj dorem.obj init.obj dosubst.obj files.obj
- X
- SHAR_EOF
- $TOUCH -am 1101134890 remind.mak &&
- chmod 0600 remind.mak ||
- echo "restore of remind.mak failed"
- set `wc -c remind.mak`;Wc_c=$1
- if test "$Wc_c" != "665"; then
- echo original size 665, current size $Wc_c
- fi
- fi
- exit 0
-