home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / desktop / rem22_05.arj / REMIND.DOC < prev    next >
Text File  |  1990-12-19  |  44KB  |  1,199 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                     REMIND 2.2 #5 
  9.  
  10.                                    By David Skoll
  11.  
  12.                                (C) 1990 by David Skoll
  13.  
  14.                                   19 December 1990
  15.  
  16.  
  17.  
  18.                   To print this document, type: COPY REMIND.DOC PRN
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                          Table of Contents
  25.  
  26.  
  27.           1. INTRODUCTION  . . . . . . . . . . . . . . . . . . . . . . .   1
  28.  
  29.           2. THE FINE PRINT  . . . . . . . . . . . . . . . . . . . . . .   2
  30.  
  31.           3. USING REMIND  . . . . . . . . . . . . . . . . . . . . . . .   3
  32.                3.1. Running REMIND . . . . . . . . . . . . . . . . . . .   3
  33.                3.2. The REM Command  . . . . . . . . . . . . . . . . . .   4
  34.                     3.2.1. Date specifications . . . . . . . . . . . . .   5
  35.                     3.2.2. Backward Scanning . . . . . . . . . . . . . .   7
  36.                     3.2.3. Advance Warning . . . . . . . . . . . . . . .   7
  37.                     3.2.4. The MSG Keyword . . . . . . . . . . . . . . .   8
  38.                     3.2.5. The RUN Keyword . . . . . . . . . . . . . . .   8
  39.                     3.2.6. Getting Reminded only Once per Day  . . . . .   8
  40.                     3.2.7. Locally Omitting Weekdays . . . . . . . . . .   8
  41.                     3.2.8. Periodic Reminders  . . . . . . . . . . . . .   9
  42.                     3.2.9. The AT Keyword  . . . . . . . . . . . . . . .   9
  43.                     3.2.10. The BEFORE, SKIP and AFTER Keywords  . . . .  10
  44.                3.3. The OMIT Command . . . . . . . . . . . . . . . . . .  10
  45.                3.4. The INCLUDE Command  . . . . . . . . . . . . . . . .  11
  46.                3.5. Substitution . . . . . . . . . . . . . . . . . . . .  12
  47.                3.6. Producing a Calendar . . . . . . . . . . . . . . . .  16
  48.                3.7. The BANNER Command . . . . . . . . . . . . . . . . .  16
  49.  
  50.           4. PURGING REMINDER FILES  . . . . . . . . . . . . . . . . . .  17
  51.  
  52.           5. DEBUGGING YOUR REMINDER FILE  . . . . . . . . . . . . . . .  18
  53.                5.1. Format of Debugging and Error Messages . . . . . . .  18
  54.  
  55.           6. WISH LIST . . . . . . . . . . . . . . . . . . . . . . . . .  18
  56.  
  57.           7. WISHES LIST . . . . . . . . . . . . . . . . . . . . . . . .  19
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.           REMIND 2.2   (19 December 1990)                             Page i
  78.  
  79.  
  80.  
  81.  
  82.  
  83.           1. INTRODUCTION
  84.  
  85.           REMIND version 2.2 is an enhanced reminder program.  It is similar
  86.           to the Unix "calendar" program, only much more versatile and with
  87.           enhanced features.
  88.  
  89.           REMIND reads a text file (which you create) containing a list of
  90.           commands.  Most of these commands are "reminders" which are issued
  91.           whenever the current date meets specified criteria.  The reminders
  92.           can print a message to the console or run a program.
  93.  
  94.           Some features of REMIND include the following:
  95.  
  96.           o    Ability to issue a reminder any number of days in advance
  97.  
  98.           o    Ability to skip holidays and weekends when reminding in
  99.                advance
  100.  
  101.           o    Ability to include standard files for system-wide reminders
  102.                or standard sets of holidays
  103.  
  104.           o    Advanced date calculation
  105.  
  106.           o    Ability to run a program rather than display a message when a
  107.                reminder is issued
  108.  
  109.           o    Ability to purge reminder file to remove obsolete reminders
  110.  
  111.           o    Ability to create a calendar with your reminders
  112.                automatically filled in on the appropriate dates
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.           REMIND 2.2   (19 December 1990)                             Page 1
  137.  
  138.  
  139.  
  140.  
  141.  
  142.           2. THE FINE PRINT
  143.  
  144.           REMIND is yours to keep, use, distribute and enjoy.  However,
  145.           there are some things you can't do:
  146.  
  147.           i)   You can't claim that you (or anyone other than I) wrote
  148.                REMIND.
  149.  
  150.           ii)  You can't distribute REMIND for profit.
  151.  
  152.           iii) You can't distribute a modified version of REMIND, or a
  153.                version of REMIND which is missing this document.
  154.  
  155.           REMIND is copyright (C) 1990 by David Skoll.
  156.  
  157.           If you wish to support the creation of software like REMIND, you
  158.           can send me a donation.  Any amount would be appreciated; the
  159.           suggested amount is $18.  Note that this is strictly voluntary. If
  160.           you don't make a donation, you don't suffer any penalties.  If you
  161.           make a donation, you don't get any special service for it.  But
  162.           you will have helped support the creation of useful and
  163.           reasonably-priced software.
  164.  
  165.           My mailing address is:
  166.  
  167.           David Skoll
  168.           4-317 LeBreton Street
  169.           Ottawa, Ontario
  170.           K1S 4L4 Canada
  171.           Tel. (613) 567-3662
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.           REMIND 2.2   (19 December 1990)                             Page 2
  196.  
  197.  
  198.  
  199.  
  200.  
  201.           3. USING REMIND
  202.  
  203.           The first thing you need to use REMIND is a reminder file.  This
  204.           is a text file containing commands telling REMIND what to do. 
  205.           Here's a sample reminder file:
  206.  
  207.                # Sample file - by D. Skoll
  208.                BANNER Hi, Dave!  Here are your reminders:
  209.  
  210.                # First some birthdays
  211.                REM 6 Jan MSG David's birthday!
  212.                REM 23 Nov +10 MSG El's birthday is %a.
  213.  
  214.                # Next some housekeeping stuff
  215.                REM 1 -1 OMIT sat sun RUN dobackup.bat
  216.  
  217.                # Introduce some holidays
  218.                OMIT 25 dec      # Christmas
  219.                OMIT 1 jul       # Canada day
  220.                OMIT 22 nov 1990 # American thanksgiving
  221.  
  222.                # Business things
  223.                REM 23 nov 1990 +2 AT 14:00 MSG %"Meeting with Bill%" \
  224.                at %2 %a.
  225.  
  226.           Note that REMIND ignores blank lines and lines beginning with "#". 
  227.           If the last character on a line is a backslash "\", then it is
  228.           treated as a continuation character and the next line is read. 
  229.           You can string together several lines in this fashion, providing
  230.           the total length does not exceed 510 characters.  Also, commands,
  231.           names of months, etc. can be typed in any mixture of upper- and
  232.           lower-case.  The convention I use is to use upper case for REMIND
  233.           tokens like MSG, OMIT, etc. and mixed case for other words like
  234.           January and Sunday.
  235.  
  236.  
  237.           3.1. Running REMIND
  238.  
  239.           To run REMIND, simply type: 
  240.  
  241.                REMIND rem_file
  242.  
  243.           where rem_file is the name of the reminder file.  The full form of
  244.           the REMIND command line is:
  245.  
  246.           REMIND [-d | -p | -c [-w -s]] [-v] [-o] [-r] rem_file [date_spec]
  247.  
  248.           Items in square brackets are optional.  Note that you can use one
  249.           of the -d and -p options, but not both.  The meanings of the
  250.           options are:
  251.  
  252.  
  253.  
  254.           REMIND 2.2   (19 December 1990)                             Page 3
  255.  
  256.  
  257.  
  258.  
  259.  
  260.           -d   Debug mode - runs through the reminder file printing useful
  261.                information to the standard error stream.
  262.  
  263.           -p   Purge mode - purges expired reminders from the reminder file.
  264.  
  265.           -c   Calendar mode - this causes REMIND to produce a calendar for
  266.                the current month.  If you supply a number n from 1 to 12
  267.                after the c (eg, -c6), then the calendar is produced for n
  268.                months.
  269.  
  270.           -w   When used with the -c option, specify the width of the
  271.                display device when producing a calendar.  The default is -
  272.                w80; you can specify a different width. (Eg -w132 for a 132-
  273.                column printer.)
  274.  
  275.           -s   When used with the -c option, produce a "simple" calendar
  276.                listing rather than a formatted calendar.  This is useful if
  277.                you wish to write a program which produces a "prettier"
  278.                calendar than the REMIND default.
  279.  
  280.           -v   Verbose mode - prints long error and debugging messages.
  281.  
  282.           -o   Ignore the 'ONCE' directives in the reminder file.  (See the
  283.                section "Getting Reminded only Once per Day")
  284.  
  285.           -r   Ignore the 'RUN' directives in the reminder file. (See the
  286.                section "The RUN Keyword")
  287.  
  288.           date_spec Run the reminder file as if the current date were the
  289.                     specified date.  This allows you to see what reminders
  290.                     you'll get on a date in the future.  This date must be
  291.                     specified in full - for example, "6 July 1992" or "Dec
  292.                     12 1999"
  293.  
  294.           3.2. The REM Command
  295.  
  296.           The most-used command in the reminder file is the REM command. 
  297.           This command is used to denote a reminder.  The form of the REM
  298.           command is:
  299.  
  300.           REM [ONCE] [BEFORE | AFTER | SKIP] [date_spec] [delta] [back]
  301.                [repeat] [OMIT omit_list] [AT time [tdelta] [trepeat]] <MSG |
  302.                RUN> body
  303.  
  304.           Note that these should all be on one line; the descriptions
  305.           unfortunately are too long to fit on one line.  The date_spec,
  306.           delta, back and repeat can be specified in any order.  The OMIT,
  307.           if present, must follow these items.  The AT, if present, must
  308.           follow the OMIT and the other items.  The MSG or RUN must be the
  309.           last item.
  310.  
  311.  
  312.  
  313.           REMIND 2.2   (19 December 1990)                             Page 4
  314.  
  315.  
  316.  
  317.  
  318.  
  319.           3.2.1. Date specifications
  320.  
  321.           The date_spec consists of zero to four parts.  These parts are DAY
  322.           (day of month), MONTH (month name), YEAR and WEEKDAY.  MONTH and
  323.           WEEKDAY are the English names of months and weekdays.  At least
  324.           the first three characters must be used.  Case is irrelevant.  The
  325.           following are examples of the various parts of a date
  326.           specification:
  327.  
  328.           DAY:      1, 22, 31, 14, 3
  329.  
  330.           MONTH:    JANUARY, feb, March, ApR, may, june, Jul, August
  331.  
  332.           YEAR:     1990, 1993, 2030, 95 (Interpreted as 1995)
  333.                     The YEAR can range from 1990 to 2075.
  334.  
  335.           WEEKDAY:  Monday, tue, WED, Thu, Friday, saturday, sundAy
  336.  
  337.           Note that there can be several WEEKDAY components separated by
  338.           spaces.  The interpretation of date specifications is discussed
  339.           below.
  340.  
  341.           The date specification is used by REMIND to compute a TRIGGER
  342.           DATE.  The trigger date is the date on which a reminder will take
  343.           place.  Here are examples of how trigger dates are computed:
  344.  
  345.           1.   Null date_spec.  The reminder is triggered every day - the
  346.                trigger date is simply the system date.
  347.  
  348.           2.   Only DAY present.  The reminder is triggered on the specified
  349.                day of each month.  The trigger date is the closest such date
  350.                to the system date.  For example:
  351.                REM 1 MSG Triggered on first of every month.
  352.                REM 31 MSG Triggered on 31st of every month with 31 days.
  353.  
  354.           3.   Only MONTH present:  Triggered every day of the specified
  355.                month.  Example:
  356.                REM feb MSG Triggered every day in February.
  357.  
  358.           4.   DAY and MONTH present.  Examples:
  359.                REM 6 Jan MSG Triggered every 6th of January.
  360.                REM 29 Feb MSG Triggered every 29th of February.
  361.  
  362.           5.   YEAR present. Example:
  363.                REM 1990 MSG Triggered every day in 1990.
  364.  
  365.           6.   YEAR and DAY present. Examples:
  366.                REM 1 1990 MSG Triggered on first of every month in 1990.
  367.                REM 1991 23 MSG Triggered on 23rd of every month of 1991.
  368.  
  369.  
  370.  
  371.  
  372.           REMIND 2.2   (19 December 1990)                             Page 5
  373.  
  374.  
  375.  
  376.  
  377.  
  378.           7.   YEAR and MONTH present. Examples:
  379.                REM Feb 1990 MSG Triggered every day in February 1990.
  380.                REM 1991 September MSG Triggered every day in September 1991.
  381.  
  382.           8.   YEAR, MONTH and DAY present. Examples:
  383.                REM 8 January 1991 MSG Triggered on 8 Jan 1991 only.
  384.                REM 1992 March 9 MSG Triggered on 9 March 1991 only.
  385.  
  386.           9.   WEEKDAY only.  Examples:
  387.                REM Saturday MSG Triggered every Saturday.
  388.                REM mon tue wed thu fri MSG Triggered every working day.
  389.                REM mon wed MSG Triggered every Monday and Wednesday.
  390.  
  391.           10.  WEEKDAY and DAY.  Examples:
  392.                REM Sat 1 MSG Triggered on the first Saturday of each month.
  393.                REM Mon Tue Wed Thu Fri 15 MSG Triggered on the first working
  394.                     day on or after the 15th of each month.
  395.  
  396.           11.  WEEKDAY and MONTH.  Examples:
  397.                REM mon march MSG Triggered every Monday in March.
  398.                REM mon tue wed thu fri feb MSG Triggered every working day
  399.                     in February.
  400.  
  401.           12.  WEEKDAY, MONTH and DAY.  Examples:
  402.                REM mon 1 March MSG Triggered on the first Monday in March
  403.                REM sat sun 15 July MSG Triggered on the first Saturday or
  404.                     Sunday on or after the 15th of July.
  405.  
  406.           13.  WEEKDAY and YEAR.  Example:
  407.                REM sat sun 1991 MSG Triggered every Saturday and Sunday in
  408.                     1991.
  409.  
  410.           14.  WEEKDAY, DAY and YEAR.  Examples:
  411.                REM mon 15 1990 MSG First Monday after the 15th of every
  412.                     month in 1990.
  413.                REM mon tue wed thu fri 1 1990 MSG First working dat of
  414.                     every month in 1990.
  415.  
  416.           15.  WEEKDAY, MONTH and YEAR.  Example:
  417.                REM Mon Wednesday 1991 Feb MSG Every Monday and Wednesday in
  418.                     February 1991.
  419.  
  420.           16.  WEEKDAY, DAY, MONTH and YEAR.  Example:
  421.                REM mon tue wed thu fri 28 Oct 1990 MSG First working day on
  422.                     or after 28 October 1990.
  423.  
  424.           Note that when WEEKDAY and DAY are specified, REMIND chooses the
  425.           first date on or after the specified DAY which also satisfies the
  426.           WEEKDAY constraint.  It does this by picking the first date on or
  427.           after the specified DAY which is listed in the list of WEEKDAYs. 
  428.           Thus, a reminder like
  429.  
  430.  
  431.           REMIND 2.2   (19 December 1990)                             Page 6
  432.  
  433.  
  434.  
  435.  
  436.  
  437.                REM Mon Tue 28 Oct 1990 MSG Hi
  438.  
  439.           would be issued only on Monday, 29 October, 1990.  It would not be
  440.           issued on Tuesday, 30 October, 1990 since the 29th satisfies the
  441.           constraints.
  442.  
  443.           3.2.2. Backward Scanning
  444.  
  445.           Sometimes, you need to incorporate "backward scanning" into your
  446.           date specification.  This is accomplished with the "back" part of
  447.           the reminder specification.  If present, the back is specified as
  448.           a negative number.  This causes REMIND to compute the trigger date
  449.           and then move back the specified number of days.  For example:
  450.  
  451.                REM Mon 1 -7 MSG The LAST Monday of every month.
  452.  
  453.           This works by finding the first Monday of every month and then
  454.           moving "back" seven days.  This results in the last Monday of the
  455.           previous month.  Another example:
  456.  
  457.                REM 1 -1 MSG The LAST day of every month.
  458.  
  459.           Since we don't know how many days are in a month, to get to the
  460.           last day of a month, we go to the first day of the next month and
  461.           then move back one day.
  462.  
  463.           Remind will automatically scan forwards and backwards until it
  464.           finds a trigger date meeting the criteria.  Note that a back value
  465.           greater than 7 can lead to excessive backtracking and long
  466.           execution time.
  467.  
  468.           3.2.3. Advance Warning
  469.  
  470.           REMIND can warn you of an upcoming reminder as far in advance as
  471.           you desire.  This is specified by a delta, which is a positive
  472.           number prefaced with a "+" sign.  For example:
  473.  
  474.                REM 8 Jan 1992 +3 MSG This reminder is emitted starting 3
  475.                     days before January 8 1992.
  476.  
  477.                REM 1 +1 MSG This reminder is emitted on the first of every
  478.                     month, as well as the last day of the preceding month.
  479.  
  480.           In summary, a reminder with a delta is triggered on the usual
  481.           date, as well as all days preceding the trigger date by up to
  482.           "delta" days.  This is useful for being reminded of birthdays well
  483.           in advance!
  484.  
  485.           Deltas and backs can be combined:
  486.  
  487.                REM Mon 1 -7 +3 MSG Emitted on the last Monday of every month
  488.                     as well as the 3 days preceding it.
  489.  
  490.           REMIND 2.2   (19 December 1990)                             Page 7
  491.  
  492.  
  493.  
  494.  
  495.  
  496.           3.2.4. The MSG Keyword
  497.  
  498.           The MSG keyword causes the remaining part of the line to be
  499.           printed to standard output when the reminder is triggered.  The
  500.           line is first passed through a substitution routine before being
  501.           printed.  See the section "Substitution" for details about
  502.           substitution.
  503.  
  504.           3.2.5. The RUN Keyword
  505.  
  506.           The RUN keyword causes the remaining part of the line to be passed
  507.           through the substitution routine, and then passed to the shell for
  508.           execution as if you had typed the command at the shell prompt. 
  509.  
  510.           3.2.6. Getting Reminded only Once per Day
  511.  
  512.           In some situations, you only want a reminder emitted once per day. 
  513.           This is useful if the reminder runs a program which should be run
  514.           only once.  (Typically, such a reminder would have no delta. 
  515.           Otherwise, the program would be run once for each day within the
  516.           delta preceding the trigger date.)
  517.  
  518.           When REMIND finishes processing a file, it marks the modification
  519.           date of the file with the current system date.  When it is run the
  520.           next time, if the file modification date and the system date are
  521.           the same, it ignores reminders which contain the ONCE keyword. 
  522.           For example:
  523.  
  524.                REM ONCE 1 Mon RUN do_backup
  525.  
  526.           This reminder runs the program "do_backup" on the first Monday of
  527.           each month.  It runs it only the first time REMIND is invoked.  If
  528.           REMIND is subsequently invoked on the same day, this reminder is
  529.           ignored.
  530.  
  531.           3.2.7. Locally Omitting Weekdays
  532.  
  533.           A reminder containing the keyword OMIT followed by a list of
  534.           weekdays causes the delta and back to ignore the specified days
  535.           when moving backwards.  This is called a "local omit." For
  536.           example:
  537.  
  538.                REM 1 +1 OMIT sat sun MSG Hello there!
  539.  
  540.           This reminder prints the message "Hello there!" on the first day
  541.           of each month, and the day before.  If, however, the first day of
  542.           the month falls on a Sunday or Monday, the message is also issued
  543.           on the preceding Friday, since the delta does not count Saturday
  544.           and Sunday as it moves backwards.
  545.  
  546.                REM 1 -1 +1 OMIT sat sun MSG Hi there!
  547.  
  548.  
  549.           REMIND 2.2   (19 December 1990)                             Page 8
  550.  
  551.  
  552.  
  553.  
  554.  
  555.           This one issues a reminder on the last working day of each month,
  556.           as well as the preceding working day.  Let's look at it in detail:
  557.  
  558.           The "1" specifies the first of each month.  The "back" of -1 tells
  559.           REMIND to go backwards by one day, not counting Saturday and
  560.           Sunday as it moves.  This takes us to the last working day of the
  561.           preceding month.  The delta of +1 ensures that the reminder will
  562.           be emitted on the day preceding this day also.  Finally, if the
  563.           last working day of the month happens to be a Monday, the delta
  564.           combined with the local OMIT causes the reminder to be issued the
  565.           Friday before.  Play around with deltas, backs and OMITs.  They
  566.           can be very powerful and quickly become easy to understand.
  567.  
  568.           3.2.8. Periodic Reminders
  569.  
  570.           Sometimes reminders repeat periodically, where the repetition
  571.           period is a specific number of days.  To create a repeating
  572.           reminder, use the "repeat" item, which is a number preceded by an
  573.           asterisk.  (Example: *14)  You supply a start date and the
  574.           repetition factor, and REMIND will trigger the reminder
  575.           periodically.  Note that to use a repetition factor, you must
  576.           specify DAY, MONTH and YEAR in the date-spec.  You can use
  577.           WEEKDAYS, deltas, backs and OMITS in the date-spec.  However,
  578.           these are used ONLY in the calculation of the start date.  Once
  579.           the start date has been calculated, OMITs are ignored and the
  580.           reminder is triggered in strict multiples of the period after the
  581.           start date.
  582.  
  583.           For example, suppose you get paid every second Thursday, and that
  584.           8 November 1990 was a payday.  You can be reminded of your payday
  585.           with this reminder:
  586.  
  587.                REM 8 Oct 1990 +3 *14 MSG Payday is %b.
  588.  
  589.           The delta of +3 means you'll be warned 3 days ahead of every
  590.           payday.  The repeat of *14 means that the reminder will be
  591.           triggered every 14 days starting from 8 October 1990.
  592.  
  593.           3.2.9. The AT Keyword
  594.  
  595.           The AT keyword specifies a time for reminders which have times
  596.           associated with them.  You should follow the AT keyword with a
  597.           time in 24-hour format, from 0:00 to 23:59.  The tdelta and
  598.           trepeat items have the same format as delta and repeats for dates. 
  599.           They are used in the UNIX version of REMIND to specify how many
  600.           minutes and over what interval to repeatedly pop up timed
  601.           reminders.  These fields are accepted by the MS-DOS version of
  602.           REMIND, but do not serve any useful purpose.  The AT keyword does,
  603.           however, cause reminders to be sorted by time when placed on the
  604.           calendar listing.  Here are examples of how to use AT:
  605.  
  606.           REM AT 17:00 MSG Work ends at %2!
  607.  
  608.           REMIND 2.2   (19 December 1990)                             Page 9
  609.  
  610.  
  611.  
  612.  
  613.  
  614.           REM 8 July 1991 AT 10:00 MSG Meeting with Bill %1.
  615.  
  616.           3.2.10. The BEFORE, SKIP and AFTER Keywords
  617.  
  618.           Normally, if a reminder falls on a holiday (see "The OMIT
  619.           Command"), the reminder is still issued.  This can cause some
  620.           strange effects.  Consider the following:
  621.  
  622.           OMIT 25 Dec    # Xmas Holiday
  623.           OMIT 1 Jan     # New Year's Day
  624.           REM Tue MSG Departmental meeting.
  625.  
  626.           The reminder "Departmental meeting"  would be issued every
  627.           Tuesday, including 25 December, 1990, and 1 January, 1991, even
  628.           though those days are holidays.  If, however, you use the SKIP
  629.           keyword:
  630.  
  631.           REM SKIP Tue MSG Departmental meeting.
  632.  
  633.           then the reminder would be issued every Tuesday, except on those
  634.           Tuesdays which happen to be holidays.  The BEFORE keyword would
  635.           cause the reminder to be issued on Tuesdays, unless the Tuesday is
  636.           a holiday.  In that case, the reminder would be issued the Monday
  637.           before.  The AFTER keyword is similar, except that the reminder
  638.           would be issued on the Wednesday following any holidays occurring
  639.           on Tuesday.
  640.  
  641.           In summary:  The SKIP keyword causes reminder which happen to fall
  642.           on globally or locally omitted days not to be issued.  The BEFORE
  643.           keyword moves reminders to the first non-omitted day prior to the
  644.           holiday.  The AFTER keyword moves them to the first non-omitted
  645.           day after the holiday.  Here are some examples:
  646.  
  647.           REM AFTER 1 OMIT Sat Sun RUN Backup_on_first_working_day_of_month
  648.           REM SKIP Tue MSG Weekly Meeting
  649.           REM BEFORE 4 Dec 1991 *14 MSG Payday on every second Tuesday;\
  650.                Monday if that Tuesday happens to be a holiday.
  651.  
  652.  
  653.           3.3. The OMIT Command
  654.  
  655.           In addition to being part of a REM command, the OMIT keyword can
  656.           act as a command in its own right.  When used this way, it is
  657.           called a "global omit" and is used to specify holidays.  The OMIT
  658.           command has two forms:
  659.  
  660.                OMIT month day
  661.                OMIT year month day
  662.  
  663.           The components can be in any order.  For convenience, you can also
  664.           specify a DELTA and a RUN or MSG, as with the REM command.  This
  665.           is used to avoid duplication.  For example, the command:
  666.  
  667.           REMIND 2.2   (19 December 1990)                            Page 10
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.                OMIT 25 Dec +3 MSG %"Christmas%" is %a.
  675.  
  676.           is exactly equivalent to:
  677.  
  678.                OMIT 25 Dec
  679.                REM 25 Dec +3 MSG %"Christmas%" is %a.
  680.  
  681.           The first format is used for holidays which fall on the same day
  682.           each year.  For example:
  683.  
  684.                OMIT 25 December  # Christmas
  685.                OMIT 1  January   # New year's day.
  686.  
  687.           The second format is used for holidays which move from year to
  688.           year.  For example:
  689.  
  690.                OMIT 12 October 1990 # Columbus day 1990
  691.                OMIT 22 November 1990 # Thanksgiving day 1990
  692.  
  693.           These dates are omitted by the "back" and "delta" portions of a
  694.           reminder, in addition to any local omits.  For example:
  695.  
  696.                OMIT 25 December
  697.                REM 26 +1 OMIT sat sun MSG Test2
  698.  
  699.           This would issue the reminder on the 26th of each month, as well
  700.           as the working day preceding it.  Also, on the 24th of December,
  701.           1990, the reminder would be issued.  Even though Christmas 1990 is
  702.           on a Tuesday, the global OMIT would cause the delta to skip it.
  703.  
  704.           Global OMITS are in force for all reminders following them in the
  705.           reminder file.  Thus, you could have a series of reminders like
  706.           birthdays, etc. for which global omits may not be necessary.  You
  707.           can then place the global holiday list in your file, followed by
  708.           business reminders for which omission of holidays would be
  709.           appropriate.
  710.  
  711.  
  712.           3.4. The INCLUDE Command
  713.  
  714.           The INCLUDE command takes the following form:
  715.  
  716.                INCLUDE filename
  717.  
  718.           This causes REMIND to suspend the current file and read the
  719.           contents of the specified filename.  Once that file has been read,
  720.           REMIND continues reading the original file from the line after the
  721.           INCLUDE command.  INCLUDEs can be nested to a maximum level of 10.
  722.  
  723.           INCLUDE allows you or someone else to maintain a file of standard
  724.           holidays (global OMITS) or system-wide reminders that everyone
  725.  
  726.           REMIND 2.2   (19 December 1990)                            Page 11
  727.  
  728.  
  729.  
  730.  
  731.  
  732.           should get.  For example, your local reminder file could look like
  733.           this:
  734.  
  735.                # Example shown for MS-DOS
  736.                INCLUDE \etc\holidays.sys  # System-wide holidays
  737.                INCLUDE \etc\remind.sys    # Standard system-wide reminders
  738.  
  739.                # Now my private reminders go here.
  740.  
  741.           When you're PURGING a file (See the section "Purging Reminder
  742.           Files" ) only the top-level file is used for purging.  Any
  743.           INCLUDEd files are read and processed, but not purged.
  744.  
  745.           The ONCE keyword operates on the modification date of the top-
  746.           level file.  The modification dates of INCLUDEd files are not used
  747.           to control the operation of the ONCE keyword.
  748.  
  749.           3.5. Substitution
  750.  
  751.           Before being processed, the body of a RUN or MSG command is run
  752.           through a substitution filter.  This filter makes certain
  753.           substitutions in the body.  The substitutions are marked by a '%'
  754.           symbol followed by a letter.  Whenever these sequences occur, they
  755.           are replaced with text as determined below.  All dates referred to
  756.           are the trigger date of the specified reminder.
  757.  
  758.           %a * Replaced with "on WKDAY, DAY MONTH, YEAR"
  759.  
  760.                For example, consider the reminder:
  761.                "REM 18 Oct 1990 +4 MSG Meeting with Bob %a."
  762.  
  763.                If reminder were run on 16 October 1990, this would print:
  764.                "Meeting with Bob on Thursday, 18 October, 1990."
  765.  
  766.                On 17 October 1990, the message would be:
  767.                "Meeting with Bob tomorrow."
  768.  
  769.                On 18 October 1990, it would be:
  770.                "Meeting with Bob today."
  771.  
  772.           %b * Replaced with "in DIFF days' time"
  773.  
  774.                Example:  "REM 18 Oct 1990 +4 MSG Meeting with Bob %b."
  775.  
  776.                16 Oct 1990: "Meeting with Bob in 2 days' time."
  777.                17 Oct 1990: "Meeting with Bob tomorrow."
  778.                18 Oct 1990: "Meeting with Bob today."
  779.  
  780.                Note that the number printed is the ACTUAL number of days
  781.                between the current date and the trigger date.  The OMIT
  782.                lists have no effect on this number.
  783.  
  784.  
  785.           REMIND 2.2   (19 December 1990)                            Page 12
  786.  
  787.  
  788.  
  789.  
  790.  
  791.           %c * Replaced with "on WKDAY"
  792.  
  793.                Example:  "REM 18 Oct 1990 +4 MSG Meeting with Bob %b."
  794.  
  795.                16 Oct 1990: "Meeting with Bob on Thursday."
  796.                17 Oct 1990: "Meeting with Bob tomorrow."
  797.                18 Oct 1990: "Meeting with Bob today."
  798.  
  799.           %d   Replaced with the day of the month.
  800.  
  801.           %e * Replaced with "on dd/mm/yyyy"
  802.  
  803.           %f * Replaced with "on mm/dd/yyyy"
  804.  
  805.           %g * Replaced with "on WKDAY, DAY MONTH"
  806.  
  807.           %h * Replaced with "on dd/mm"
  808.  
  809.           %i * Replaced with "on mm/dd"
  810.  
  811.           %j * Replaced with "on WKDAY, MONTH DAYth, YEAR"
  812.  
  813.                This is replaced with things of the form "on Monday, October
  814.                8th, 1990" or "on Sunday, October 21st, 1990" with the "st",
  815.                "nd", "rd", "th" as appropriate after the day of the month.
  816.  
  817.           %k * Replaced with "on WKDAY, MONTH DAYth"
  818.  
  819.           %l * Replaced with "on yyyy/mm/dd"
  820.  
  821.           %m   Replaced with the name of the month.
  822.  
  823.           %n   Replaced with the number (1 - 12) of the month.
  824.  
  825.           %o   Replaced with " (today)" if and only if the current system
  826.                date is the same as the date used by REMIND as the current
  827.                date.  Recall that you can specify a date for REMIND to use
  828.                on the command line.  This substitution is not generally
  829.                useful in a REMinder, but is useful in a BANNER statement. 
  830.                See the section 'The BANNER Command'.
  831.  
  832.           %p   Replaced with "s" if the DIFF between the current date and
  833.                the trigger date is not 1.  You can use this to construct
  834.                reminders like:
  835.  
  836.                REM 1 Jan +4 MSG %x day%p to go before New Year's Day!
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.           REMIND 2.2   (19 December 1990)                            Page 13
  845.  
  846.  
  847.  
  848.  
  849.  
  850.           %q   Replaced with "'s" if the DIFF between the current date and
  851.                trigger date is 1.  Otherwise, replaced with "s'"  This can
  852.                be used as follows:
  853.  
  854.                REM 1 Jan +4 MSG New Year's Day in %x day%q time!
  855.  
  856.           %r   Replaced with the day of the month (01-31) with leading zero
  857.                if needed to pad to two digits.
  858.  
  859.           %s   Replaced with "st", "nd", "rd" or "th" depending on the day
  860.                of the month.  Example:
  861.  
  862.                REM 1 Mon +3 MSG First Monday of %m is the %d%s.
  863.  
  864.                For October, 1990, this would print:
  865.                "First Monday of October is the 1st."
  866.  
  867.                For November, 1990, it would print:
  868.                "First Monday of November is the 5th."
  869.  
  870.           %t   The number of the month (01 - 12) padded to two digits with
  871.                leading zero if necessary.
  872.  
  873.           %u * Replaced with "on WKDAY, DAYth MONTH, YEAR"
  874.                This is the same as %a except "st", "nd", etc. is added to
  875.                the day of the month.
  876.  
  877.           %v * Replaced with "on WKDAY, DAYth MONTH"
  878.  
  879.           %w   Replaced with "WKDAY", the name of the day of the week.
  880.  
  881.           %x   Replaced with the DIFF between the current date and the
  882.                trigger date.  The DIFF is defined as the number of days
  883.                between the current date and the trigger date.  OMITs are not
  884.                counted; strict date subtraction is performed.
  885.  
  886.           %y   Replaced with "YEAR", the year of the trigger date.
  887.  
  888.           %z   Replaced with "yy", the last two digits of the year.
  889.  
  890.           %_   (Percent-underscore) replaced with a newline.  You can use
  891.                this to achieve multi-line reminders.
  892.  
  893.           %1   Replaced with "now", "m minutes from now", "m minutes ago",
  894.                "h hours from now", "h hours and m minutes from now", etc.,
  895.                as appropriate for a timed reminder.  Note that timer
  896.                reminders are triggered like normal reminders - only the date
  897.                portion is considered.  This causes the need for the "...ago"
  898.                forms.
  899.  
  900.           %2   Replaced with "hh:mm" followed by "am" or "pm" as
  901.                appropriate.
  902.  
  903.           REMIND 2.2   (19 December 1990)                            Page 14
  904.  
  905.  
  906.  
  907.  
  908.  
  909.           %3   Replaced with "hh:mm", the AT time in 24-hour format.
  910.  
  911.           %4   Replaced with "mm", where mm is the number of minutes between
  912.                "now" and the time specified by AT.  If the AT time is
  913.                earlier than the current time, this number is negative.
  914.  
  915.           %5   Replaced with "ma", where ma is the absolute value of the
  916.                number produced by %4.
  917.  
  918.           %6   Replaced with "ago" or "from now", depending on the
  919.                relationship between the AT time and the current time.
  920.  
  921.           %7   Replaced with the number of hours between the current time
  922.                and the AT time.  This number is always non-negative.
  923.  
  924.           %8   Replaced with the number of minutes between the current time
  925.                and the AT time, after the hours (%7) have been subtracted
  926.                out.  This is a number from 0 to 59.
  927.  
  928.           %9   Replaced with "s" if the number produced by "%8" is not 1.
  929.  
  930.           %0   Replaced with "s" if the number produced by "%7" is not 1.
  931.  
  932.           %!   Replaced with "is" if the current time is before the AT time,
  933.                or "was" if it is after.
  934.  
  935.           %"   (percent-doublequote) is removed.  This sequence is not used
  936.                by the substitution filter, but is used to tell REMIND which
  937.                text to include in a calendar entry when the -c option is
  938.                chosen.  See the section "Producing a Calendar"
  939.  
  940.           Notes:
  941.  
  942.           o    REMIND normally prints a blank line after each reminder. 
  943.                However, if the last character of the body is "%", then the
  944.                blank line will not be printed.
  945.  
  946.           o    All substitution sequences marked with "*" are replaced with
  947.                "today" if the current date equals the trigger date, or
  948.                "tomorrow" if the trigger date is one day after the current
  949.                date.
  950.  
  951.           o    Any of the substitutions dealing with time (0 though 9 and
  952.                "!") produce undefined results if used in a reminder without
  953.                the AT keyword.  Also, if a reminder has a delta and may be
  954.                triggered on several days, the time substitutions ignore the
  955.                date.  Thus, the "%1" substitution may report that a meeting
  956.                is in 15 minutes, for example, even though it may only be in
  957.                2 days time.  It is recommended that you use the "%1"
  958.                substitution only on reminders with no delta.
  959.  
  960.  
  961.  
  962.           REMIND 2.2   (19 December 1990)                            Page 15
  963.  
  964.  
  965.  
  966.  
  967.  
  968.           o    Capital letters can be used, in which case the first letter
  969.                of the substituted text is capitalized.
  970.  
  971.           o    All other characters following a "%" sign are simply copied. 
  972.                In particular, to get a "%" sign out, use "%%" in the body. 
  973.                To start a body with a space, use "% " since REMIND normally
  974.                scans for the first non-space character after the MSG or RUN
  975.                token.
  976.  
  977.           3.6. Producing a Calendar
  978.  
  979.           REMIND can be used to create a calendar based on the contents of
  980.           your reminder file.  This is done by invoking REMIND with the -c
  981.           option.
  982.  
  983.           When you produce a calendar, REMIND will not pass the text through
  984.           the subsititution mechanism.  Thus, you must indicate to REMIND
  985.           which portions of the text should be placed in the calendar.  This
  986.           is done with the %" sequence.  Here's an example:
  987.  
  988.                REM 6 Jan +6 MSG %"David's birthday%" is %a.
  989.  
  990.           When you run REMIND normally, it triggers the reminder as if the
  991.           %" sequences were not there.  When you produce a calendar with the
  992.           -c option, however, only the text "David's birthday" is placed
  993.           into the calendar.  For convenience, timed reminders are sorted by
  994.           time before being entered into the calendar, and the time of each
  995.           reminder is printed before the text.
  996.  
  997.           Note that only MSG reminders are included in the calendar; RUN
  998.           reminders are ignored.  If you indicate empty text for the
  999.           calendar entry with the sequence %"%" in the reminder body, then
  1000.           the reminder will be ignored when producing the calendar.
  1001.  
  1002.           3.7. The BANNER Command
  1003.  
  1004.           When REMIND issues reminders, it normally prints a message saying:
  1005.  
  1006.                "Reminders for WKDAY, DAYth MONTH, YEAR (today):" 
  1007.  
  1008.           if it is running with the current date equal to the system date. 
  1009.           If it is running with a different date supplied via the command
  1010.           line, it leaves out the " (today):"
  1011.  
  1012.           You can change this default to anything you want with the BANNER
  1013.           command.  It should appear in the reminder file before any REM
  1014.           commands.  (This is not enforced, but a BANNER command encountered
  1015.           after a reminder has been issued will be ignored.)
  1016.  
  1017.           The format of BANNER is:  BANNER string
  1018.  
  1019.           The string is passed through the substitution mechanism described
  1020.  
  1021.           REMIND 2.2   (19 December 1990)                            Page 16
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.           above, using the current date for substitution.  The standard
  1028.           banner is described by:
  1029.  
  1030.                BANNER Reminders for %w, %d%s %m, %y%o:
  1031.  
  1032.           You can have a blank banner by using:
  1033.  
  1034.                BANNER %
  1035.  
  1036.           4. PURGING REMINDER FILES
  1037.  
  1038.           You should periodically purge your reminder file of "expired" REM
  1039.           commands and OMITs.  These are reminders which took place in the
  1040.           past and can never happen again, or OMITs which are for past
  1041.           years.  Of course, only REMs and OMITs with the YEAR specified can
  1042.           ever expire.
  1043.  
  1044.           To purge your file, run REMIND in purge mode.  This mode simply
  1045.           echoes non-expired lines to standard output, and expired lines to
  1046.           standard error.  Thus, to purge a file, you could type:
  1047.  
  1048.                REMIND -p notes.old > notes.new
  1049.  
  1050.           The file "notes.new" would contain all non-expired lines from
  1051.           notes.old.  All expired lines would be echoed to the screen. 
  1052.           INCLUDEd files are read and processed, but are not purged.  You
  1053.           must purge each INCLUDEd file separately.
  1054.  
  1055.           Note that reminders which do not specify a YEAR, as well as
  1056.           repeating reminders, can never expire.
  1057.  
  1058.           You can supply a date on the command line when purging, but
  1059.           beware:  If you supply a date in the future, you may inadvertantly
  1060.           purge lines which have not really expired yet.
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072.  
  1073.  
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080.           REMIND 2.2   (19 December 1990)                            Page 17
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086.           5. DEBUGGING YOUR REMINDER FILE
  1087.  
  1088.           The debug flag (-d) is used to debug reminder files (not the
  1089.           REMIND program!)  It tells you all sorts of useful information
  1090.           about the reminder file.  It displays the trigger date of each
  1091.           reminder, and places an asterisk by those which would be issued on
  1092.           the current date.  It also informs you of OMITs which have
  1093.           expired, and gives several warnings about situations which could
  1094.           lead to long execution time or unexpected results.
  1095.  
  1096.           If you have a long reminder file, you may want to redirect the
  1097.           standard error stream.  In Unix, this is accomplished easily.  In
  1098.           MS-DOS, you can use the E2O program supplied with REMIND.
  1099.  
  1100.           5.1. Format of Debugging and Error Messages
  1101.  
  1102.           REMIND prints the filename, followed by the line number in
  1103.           brackets, followed by the error or debugging message.  If the
  1104.           verbose flag (-v) is supplied, it echoes the line from the file as
  1105.           well.
  1106.  
  1107.  
  1108.           6. WISH LIST
  1109.  
  1110.           o    REMIND has been ported to Unix.  The source has been posted
  1111.                on alt.sources on the usenet.  It's also available in the
  1112.                file /pub/remind-2.2.tar.Z via anonymous ftp from
  1113.                alfred.ccs.carleton.ca (134.117.1.1)
  1114.  
  1115.           o    Faster algorithms for date calculation.  Most of the
  1116.                algorithms are fairly "brute force", but they execute
  1117.                reasonably quickly.  The "back" feature especially leads to a
  1118.                lot of backtracking.
  1119.  
  1120.           o    A prettier interface - maybe some snazzy pop-up windows, with
  1121.                centered messages, colors and so on... hell, if you really
  1122.                want that, use REMIND as a back-end and do some post-
  1123.                processing on its output.  Easy from Unix, slow from MS-DOS.
  1124.  
  1125.           o    Automatic purging of reminder files.  Could be useful or
  1126.                dangerous, depending on your perspective.
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.           REMIND 2.2   (19 December 1990)                            Page 18
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.           7. WISHES LIST
  1146.  
  1147.           I hope you enjoy using REMIND.  If you have any suggestions,
  1148.           comments, bugs, problems, donations :-) or kudos, send them to:
  1149.  
  1150.           David Skoll
  1151.           4-317 Lebreton Street
  1152.           Ottawa, Ontario
  1153.           K1S 4L4  CANADA
  1154.           Tel. (613) 567-3662
  1155.  
  1156.           I can be reached by e-mail at dfs@doe.carleton.ca.
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.           REMIND 2.2   (19 December 1990)                            Page 19
  1199.