home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / remin310.zip / remind.man < prev   
Text File  |  1993-11-04  |  177KB  |  4,159 lines

  1.  
  2.  
  3.  
  4. REMIND(1)                                               REMIND(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        remind - a sophisticated reminder service
  9.  
  10. SSYYNNOOPPSSIISS
  11.        rreemmiinndd [[_o_p_t_i_o_n_s] _f_i_l_e_n_a_m_e [_d_a_t_e]
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.        RReemmiinndd  reads  the supplied _f_i_l_e_n_a_m_e and executes the com-
  15.        mands found  in  it.   The  commands  are  used  to  issue
  16.        reminders  and alarms.  Each reminder or alarm can consist
  17.        of a message sent to standard output, or a program  to  be
  18.        executed.
  19.  
  20.        If _f_i_l_e_n_a_m_e is specified as a single dash '-', then RReemmiinndd
  21.        takes its input from standard input.  This also implicitly
  22.        enables the --oo option, described below.
  23.  
  24. OOPPTTIIOONNSS
  25.        --nn     The  --nn  option  causes  RReemmiinndd  to  print the nneexxtt
  26.               occurrence of each reminder in  a  simple  calendar
  27.               format.   You  can  sort this by date by piping the
  28.               output through ssoorrtt((11)).
  29.  
  30.        --rr     The --rr  option  disables  RRUUNN  directives  and  the
  31.               sshheellll(()) function
  32.  
  33.        --cc_n    The  --cc  option causes RReemmiinndd to produce a calendar
  34.               which is sent to standard output.  If you supply  a
  35.               number  _n,  then a calendar will be generated for _n
  36.               months,  starting  with  the  current  month.    By
  37.               default,  a  calendar for only the current month is
  38.               produced.  If _n starts with '+',  then  a  calendar
  39.               for _n weeks is produced.
  40.  
  41.        --ww_c_o_l[,_p_a_d[,_s_p_c]]]
  42.               The  --ww  option specifies the output width, padding
  43.               and spacing of the formatted calendar output.   _C_o_l
  44.               specifies  the  number  of  columns  in  the output
  45.               device, and defaults to 80.  _P_a_d specifies how many
  46.               lines  to  use to "pad" empty calendar boxes.  This
  47.               defaults to 5.  If you have many reminders on  cer-
  48.               tain  days,  which  make your calendar too large to
  49.               fit on a page, you can try reducing _p_a_d to make the
  50.               empty  boxes smaller.  _S_p_c specifies how many blank
  51.               lines to leave between the day number and the first
  52.               reminder entry.  It defaults to 1.
  53.  
  54.               Any  of  _c_o_l,  _p_a_d or _s_p_c can be omitted, providing
  55.               you provide the correct number  of  commas.   Don't
  56.               use any spaces in the option.
  57.  
  58.        --ss_n    The  --ss  option  is  very similar to the --cc option,
  59.               except that the output calendar is  not  formatted.
  60.               It is listed in a "simple format" which can be used
  61.  
  62.  
  63.  
  64.                          13 October 1993                        1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. REMIND(1)                                               REMIND(1)
  71.  
  72.  
  73.               as input for  more  sophisticated  calendar-drawing
  74.               programs.   If _n starts with "+", then it is inter-
  75.               preted as a number of weeks.
  76.  
  77.        --pp_n    The --pp option is very similar  to  the  --ss  option,
  78.               except that the output contains additional informa-
  79.               tion for use by the rreemm22ppss program, which creates a
  80.               PostScript  calendar.   For  this  option, _n cannot
  81.               start with "+"; it must specify a number of months.
  82.  
  83.        --mm     The  --mm  option  causes  the --cc option to produce a
  84.               calendar whose first column is Monday  rather  than
  85.               Sunday.   (This conforms to the international stan-
  86.               dard.)  It does _n_o_t, however, affect the --pp  or  --ss
  87.               options.
  88.  
  89.        --vv     The  --vv  option makes the output of RReemmiinndd slightly
  90.               more verbose.
  91.  
  92.        --oo     The --oo option causes  RReemmiinndd  to  ignore  all  OONNCCEE
  93.               directives.
  94.  
  95.        --tt     The  --tt  option  causes  RReemmiinndd to trigger all non-
  96.               expired reminders, regardless of the _d_e_l_t_a supplied
  97.               for each reminder.
  98.  
  99.        --hh     The  --hh option ("hush...") suppresses certain warn-
  100.               ing and information messages.  In particular, if no
  101.               reminders are triggered, this mode produces no out-
  102.               put.
  103.  
  104.        --aa     The --aa option  causes  RReemmiinndd  not  to  immediately
  105.               trigger timed reminders which would also be queued.
  106.               It also causes RReemmiinndd not to place timed  reminders
  107.               in a calendar.
  108.  
  109.        --qq     The  --qq  option  causes  RReemmiinndd  not to queue timed
  110.               reminders for later execution.
  111.  
  112.        --ff     The --ff option causes RReemmiinndd to remain in the  fore-
  113.               ground  when  processing  queued  reminders, rather
  114.               than forking off a  background  process  to  handle
  115.               them.
  116.  
  117.        --ee     The --ee option diverts error messages (normally sent
  118.               to the standard error stream) to the standard  out-
  119.               put stream.
  120.  
  121.        --dd_c_h_a_r_s
  122.               The --dd option enables certain debugging modes.  The
  123.               _c_h_a_r_s specify which modes to enable:
  124.  
  125.          ee      Echo all input lines
  126.  
  127.  
  128.  
  129.  
  130.                          13 October 1993                        2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. REMIND(1)                                               REMIND(1)
  137.  
  138.  
  139.          xx      Trace all expression evaluation
  140.  
  141.          tt      Display all trigger date computation
  142.  
  143.          vv      Dump the variable table after  execution  of  the
  144.                 reminder script
  145.  
  146.          ll      Echo lines when displaying error messages
  147.  
  148.        --gg[aa||dd[aa||dd[aa||dd]]]
  149.               Normally,  reminders  are  issued  in  the order in
  150.               which they are encountered in the reminder  script.
  151.               The  --gg  option  cause  RReemmiinndd to sort reminders by
  152.               date and time prior to issuing them.  The  optional
  153.               aa  and dd characters specify the sort order (ascend-
  154.               ing or descending) for the date, time and  priority
  155.               fields.   See  the  section "Sorting Reminders" for
  156.               more information.
  157.  
  158.        --bb[_n]  Set the time format for the  calendar  and  simple-
  159.               calendar  outputs.   _N  can range from 0 to 2, with
  160.               the default 0.  A value of 0  causes  times  to  be
  161.               inserted in 12-hour (am/pm) format.  1 causes times
  162.               to be inserted in 24-hour format,  and  2  inhibits
  163.               the  automatic  insertion  of times in the calendar
  164.               output.
  165.  
  166.        --xx[_n]  Sets the iteration limit for the SSAATTIISSFFYY clause  of
  167.               a RREEMM command.  Defaults to 150.
  168.  
  169.        --kk_c_m_d  Instead of simply printing MMSSGG-type reminders, this
  170.               causes them to be passed to the specific _c_m_d.   You
  171.               must  use  '%s'  where you want the body to appear,
  172.               and may need to  enclose  this  option  in  quotes.
  173.               Also, because _c_m_d is run using the ssyysstteemm(()) library
  174.               function, shell quotes in the body of  the  message
  175.               may  cause  problems.   Note that this option oovveerr--
  176.               rriiddeess the --rr option and the RRUUNN OOFFFF command.
  177.  
  178.               As an example, suppose you have an X Window program
  179.               called  xmessage,  which  pops up a window and dis-
  180.               plays its invocation arguments.  You could use:
  181.  
  182.                         remind '-kxmessage %s &' ...
  183.  
  184.               to have all of your  MMSSGG-type  reminders  processed
  185.               using xmessage.
  186.  
  187.               A word of warning:  It is very easy to spawn dozens
  188.               of xmessage processes with the above technique.  So
  189.               be  very  careful.   Also,  the _c_m_d is passed as an
  190.               argument  to  sspprriinnttff(()).   If  you  use  formatting
  191.               directives  other  than %s, or use more than one %s
  192.               directive, there's a good chance that you'll  crash
  193.  
  194.  
  195.  
  196.                          13 October 1993                        3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. REMIND(1)                                               REMIND(1)
  203.  
  204.  
  205.               RReemmiinndd.  Finally, because _c_m_d is executed using the
  206.               ssyysstteemm(()) library function, shell delimiters in MMSSGG-
  207.               type  reminders  could cause problems.  _I_n _p_a_r_t_i_c_u_-
  208.               _l_a_r_, _n_e_v_e_r _r_u_n _u_n_t_r_u_s_t_e_d  _r_e_m_i_n_d_e_r_s  _u_s_i_n_g  _t_h_e  --kk
  209.               _o_p_t_i_o_n.  A reminder like:
  210.  
  211.                    REM msg foo ; rm -Rf .
  212.  
  213.               would cause havoc if run with the --kk option.
  214.  
  215.        --zz[_n]  Runs  RReemmiinndd in the daemon mode.  If _n is supplied,
  216.               it specifies how often (in minutes)  RReemmiinndd  should
  217.               wake  up  to  check if the reminder script has been
  218.               changed.  _N defaults to 5, and can range from 5  to
  219.               60.   Note  that  the  use  of  the  --zz option also
  220.               enables the --ff option.
  221.  
  222.        --uu_n_a_m_e Runs RReemmiinndd with the uid and gid of the user speci-
  223.               fied  by  _n_a_m_e.  The option changes the uid and gid
  224.               as described, and sets  the  environment  variables
  225.               HOME,  SHELL and USER to the home directory, shell,
  226.               and user name, respectively, of the specified user.
  227.               LOGNAME  is  also  set  to the specified user name.
  228.               This option is meant for use in shell scripts which
  229.               mail reminders to all users.
  230.  
  231.               Non-root  users  can  also use the --uu option.  How-
  232.               ever, in this case, it only changes the environment
  233.               variables  as  described above.  It does not change
  234.               the effective uid or gid.
  235.  
  236.        --ii_v_a_r==_e_x_p_r
  237.               Sets the value of the specified _v_a_r  to  _e_x_p_r,  and
  238.               pprreesseerrvveess  _v_a_r.   _E_x_p_r  can  be  any  valid  RReemmiinndd
  239.               expression.  See the  section  "Initializing  Vari-
  240.               ables on the Command Line" for more details.
  241.  
  242.        If  you supply a _d_a_t_e on the command line, it must consist
  243.        of _d_a_y _m_o_n_t_h _y_e_a_r, where _d_a_y is  the  day  of  the  month,
  244.        _m_o_n_t_h  is  at least the first three letters of the English
  245.        name of the month, and _y_e_a_r is a year (all 4 digits)  from
  246.        1990 to about 2075.  You can leave out the _d_a_y, which then
  247.        defaults to 1.
  248.  
  249.        If you do supply a _d_a_t_e on the command line,  then  RReemmiinndd
  250.        uses it, rather than the actual system date, as its notion
  251.        of "today."  This lets you  create  calendars  for  future
  252.        months,  or  test  to see how your reminders will be trig-
  253.        gered in the future.
  254.  
  255.        In addition, as part of the _d_a_t_e component, you can supply
  256.        a  _r_e_p_e_a_t parameter, which has the form *_n_u_m.  This causes
  257.        RReemmiinndd to be run _n_u_m times, with the date incrementing  on
  258.        each  iteration.  You may have to enclose the parameter in
  259.  
  260.  
  261.  
  262.                          13 October 1993                        4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. REMIND(1)                                               REMIND(1)
  269.  
  270.  
  271.        quotes to  avoid  shell  expansion.   See  the  subsection
  272.        "Repeated  Execution"  in  the section "Calendar Mode" for
  273.        more information.
  274.  
  275. RREEMMIINNDDEERR FFIILLEESS
  276.        RReemmiinndd uses scripts to control its  operation.   The  com-
  277.        mands  inside  a script can range from the very simple and
  278.        almost immediately understandable:
  279.  
  280.             REM 6 Jan MSG David's birthday
  281.  
  282.        to the baroque and obscure:
  283.  
  284.             REM [trigger(date(thisyear, 1, 1) + 180)] ++5 OMIT \
  285.             sat sun BEFORE MSG [ord(thisyear-1980)] payment due %b!
  286.  
  287.        A reminder file consists of commands, with one command per
  288.        line.   Several lines can be continued using the backslash
  289.        character, as in the above example.  In this case, all  of
  290.        the  concatenated  lines  are  treated as a single line by
  291.        RReemmiinndd.  Note that if an error occurs, RReemmiinndd reports  the
  292.        line number of the last line of a continued line.
  293.  
  294.        RReemmiinndd  ignores  blank lines, and lines beginning with the
  295.        '#' or ';' characters.  You can use  the  semicolon  as  a
  296.        comment  character  if  you  wish  to pass a RReemmiinndd script
  297.        through the C  pre-processor,  which  interprets  the  '#'
  298.        character as the start of a pre-processing directive.
  299.  
  300.        RReemmiinndd  is  not  case sensitive; you can generally use any
  301.        mixture of upper- or lower-case for commands,  parameters,
  302.        invocation options, etc.
  303.  
  304. TTHHEE RREEMM CCOOMMMMAANNDD
  305.        The  most  powerful  command in a RReemmiinndd script is the RREEMM
  306.        command.   This  command  is   responsible   for   issuing
  307.        reminders.  Its syntax is:
  308.  
  309.               RREEMM  [OONNCCEE]  [_d_a_t_e___s_p_e_c]  [_b_a_c_k]  [_d_e_l_t_a]  [_r_e_p_e_a_t]
  310.               [PPRRIIOORRIITTYY _p_r_i_o]  [SSKKIIPP  |  BBEEFFOORREE  |  AAFFTTEERR]  [OOMMIITT
  311.               _o_m_i_t___l_i_s_t]  [AATT  _t_i_m_e  [_t_d_e_l_t_a]  [_t_r_e_p_e_a_t]]  [SSCCHHEEDD
  312.               _s_c_h_e_d___f_u_n_c_t_i_o_n]   [UUNNTTIILL   _e_x_p_i_r_y___d_a_t_e]   [SSCCAANNFFRROOMM
  313.               _s_c_a_n___d_a_t_e]  MMSSGG  | MMSSFF | RRUUNN | CCAALL | SSAATTIISSFFYY | PPSS |
  314.               PPSSFFIILLEE _b_o_d_y
  315.  
  316.        The parts of the RREEMM  command  can  be  specified  in  any
  317.        order,  except  that  the _b_o_d_y must come immediately after
  318.        the MMSSGG, RRUUNN, CCAALL, PPSS, PPSSFFIILLEE or SSAATTIISSFFYY keyword.
  319.  
  320.        The RREEMM token is optional, providing that the remainder of
  321.        the  command cannot be mistaken for another RReemmiinndd command
  322.        such as OOMMIITT or RRUUNN.   The  portion  of  the  RREEMM  command
  323.        before the MMSSGG, MMSSFF RRUUNN, CCAALL or SSAATTIISSFFYY clause is called a
  324.        _t_r_i_g_g_e_r.
  325.  
  326.  
  327.  
  328.                          13 October 1993                        5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. REMIND(1)                                               REMIND(1)
  335.  
  336.  
  337.        MMSSGG,, MMSSFF,, RRUUNN,, CCAALL,, PPSS aanndd PPSSFFIILLEE
  338.  
  339.        These keywords denote the _t_y_p_e of the reminder.   (SSAATTIISSFFYY
  340.        is  more complicated and will be explained later.)  A MMSSGG-
  341.        type reminder normally prints a message  to  the  standard
  342.        output, after passing the _b_o_d_y through a special substitu-
  343.        tion filter, described in the  section  "The  Substitution
  344.        Filter."   However,  if  you have used the --kk command-line
  345.        option, then MMSSGG-type reminders are passed to  the  appro-
  346.        priate  program.   Note that the options --cc, --ss, --pp and --nn
  347.        disable the --kk option.
  348.  
  349.        The MMSSFF keyword is almost the same  as  the  MMSSGG  keyword,
  350.        except  that the reminder is formatted to fit into a para-
  351.        graph-like format.  Three  system  variables  control  the
  352.        formatting  of MMSSFF-type reminders - they are $$FFiirrssttIInnddeenntt,
  353.        $$SSuubbssIInnddeenntt and $$FFoorrmmWWiiddtthh.  They  are  discussed  in  the
  354.        section  "System  Variables."   The MMSSFF keyword causes the
  355.        spacing of your reminder to be altered - extra spaces  are
  356.        discarded,  and  two  spaces  are placed after periods and
  357.        other characters, as specified  by  the  system  variables
  358.        $$EEnnddSSeenntt  and  $$EEnnddSSeennttIIgg.   Note  that if the body of the
  359.        reminder includes newline characters  (placed  there  with
  360.        the  %_  sequence),  then  the newlines are treated as the
  361.        beginnings of new paragraphs, and the $$FFiirrssttIInnddeenntt  inden-
  362.        tation is used for the next line.  You can use two consec-
  363.        utive newlines to have spaced paragraphs  emitted  from  a
  364.        single reminder body.
  365.  
  366.        A  RRUUNN-type reminder also passes the _b_o_d_y through the sub-
  367.        stitution filter, but then executes the result as a system
  368.        command.   A  CCAALL-type  reminder  is  used  only  to place
  369.        entries in the calendar produced when RReemmiinndd is  run  with
  370.        the --cc, --ss or --pp options.
  371.  
  372.        A  PPSS  or  PPSSFFIILLEE-type reminder is used to pass PostScript
  373.        code directly to the  printer  when  producing  PostScript
  374.        calendars.   This  can  be  used to shade certain calendar
  375.        entries (see the psshade() function), include graphics  in
  376.        the  calendar,  or  almost any other purpose you can think
  377.        of.  You should not use these types  of  reminders  unless
  378.        you  are  an  expert  PostScript  programmer.   The PPSS and
  379.        PPSSFFIILLEE reminders are ignored unless RReemmiinndd is run with the
  380.        --pp  option.   See  the section "More about PostScript" for
  381.        more details.
  382.  
  383.        DDAATTEE SSPPEECCIIFFIICCAATTIIOONNSS
  384.  
  385.        A _d_a_t_e___s_p_e_c consists of zero to four parts.   These  parts
  386.        are _d_a_y (day of month), _m_o_n_t_h (month name), _y_e_a_r and _w_e_e_k_-
  387.        _d_a_y_.  _M_o_n_t_h and _w_e_e_k_d_a_y are the English  names  of  months
  388.        and weekdays.  At least the first three characters must be
  389.        used.  The following are examples of the various parts  of
  390.        a _d_a_t_e___s_p_e_c_:
  391.  
  392.  
  393.  
  394.                          13 October 1993                        6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. REMIND(1)                                               REMIND(1)
  401.  
  402.  
  403.        _d_a_y_:   1, 22, 31, 14, 3
  404.  
  405.        _m_o_n_t_h_: JANUARY, feb, March, ApR, may, Aug
  406.  
  407.        _y_e_a_r_:  1990,  1993,  2030,  95 (interpreted as 1995).  The
  408.               year can range from 1990 to 2075.
  409.  
  410.        _w_e_e_k_d_a_y_:
  411.               Monday, tue, Wed, THU, Friday, saturday, sundAy
  412.  
  413.        Note that there can be several  _w_e_e_k_d_a_y  components  sepa-
  414.        rated by spaces in a _d_a_t_e___s_p_e_c_.
  415.  
  416.        IINNTTEERRPPRREETTAATTIIOONN OOFF DDAATTEE SSPPEECCIIFFIICCAATTIIOONNSS
  417.  
  418.        The  following  examples  show how date specifications are
  419.        interpreted.
  420.  
  421.        1. Null date specification -  the  reminder  is  triggered
  422.        every  day.  The trigger date for a specific run is simply
  423.        the current system date.
  424.  
  425.        2. Only _d_a_y present.  The reminder  is  triggered  on  the
  426.        specified  day of each month.  The trigger date for a par-
  427.        ticular run is the closest such day to the current  system
  428.        date.  For example:
  429.             REM 1 MSG First of every month.
  430.             REM 31 MSG 31st of every month that has 31 days.
  431.  
  432.        3.  Only  _m_o_n_t_h  present.  The reminder is triggered every
  433.        day of the specified month.  Example:
  434.             REM Feb MSG Every day in February
  435.  
  436.        4.  _d_a_y and _m_o_n_t_h present.  Examples:
  437.             REM 6 Jan MSG Every 6th of January
  438.             REM Feb 29 MSG Every 29th of February
  439.  
  440.        5.  Only _y_e_a_r present. Example:
  441.             REM 1991 MSG Every day in 1991
  442.  
  443.        6.  _y_e_a_r and _d_a_y present.  Examples:
  444.             REM 1 1990 MSG 1st of every month in 1990
  445.             REM 1992 23 MSG 23rd of every month in 1992
  446.  
  447.        7.  _y_e_a_r and _m_o_n_t_h present.  Examples:
  448.             REM Feb 1991 MSG Every day in Feb 1991
  449.             REM 1992 September MSG Every day in Sept 1992
  450.  
  451.        8.  _y_e_a_r_, _m_o_n_t_h and _d_a_y present.  Examples:
  452.             REM 8 Jan 1991 MSG 8th January 1991.
  453.             REM 1992 March 9 MSG 9th March 1992.
  454.  
  455.        9.  _w_e_e_k_d_a_y only.  Examples:
  456.             REM Sat MSG Every Saturday
  457.  
  458.  
  459.  
  460.                          13 October 1993                        7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. REMIND(1)                                               REMIND(1)
  467.  
  468.  
  469.             REM Mon Tue Wed Thu Fri MSG Every working day
  470.             REM Monday Wednesday MSG Every Monday and Wednesday
  471.  
  472.        10.  _w_e_e_k_d_a_y and _d_a_y present.  Examples:
  473.             REM Sat 1 MSG First Saturday of every month
  474.             REM Mon Tue Wed Thu Fri 15 \
  475.                  MSG 1st working day after 15th of every month
  476.  
  477.        11.  _w_e_e_k_d_a_y and _m_o_n_t_h present.  Examples:
  478.             REM Mon March MSG Every Monday in March
  479.             REM Mon Tue Wed Thu Fri Feb MSG Every working day in February
  480.  
  481.        12.  _w_e_e_k_d_a_y_, _m_o_n_t_h and _d_a_y present.  Examples:
  482.             REM Mon 1 March MSG First Monday in March
  483.             REM Sat Sun 15 July MSG First Sat or Sun on or after 15 July
  484.  
  485.        13.  _w_e_e_k_d_a_y and _y_e_a_r present.  Example:
  486.             REM Sat Sun 1991 MSG Every Saturday and Sunday in 1991
  487.  
  488.        14.  _w_e_e_k_d_a_y_, _d_a_y and _y_e_a_r present.  Examples:
  489.             REM Mon 15 1990 MSG 1st Mon after 15th of every month in 1990
  490.             REM Mon Tue Wed Thu Fri 1 1990 \
  491.                  MSG 1st working day of every month in 1990
  492.  
  493.        15.  _w_e_e_k_d_a_y_, _m_o_n_t_h and _y_e_a_r present.  Example:
  494.             REM Mon Wed 1991 Feb MSG Every Mon and Wed in Feb 1991.
  495.  
  496.        16.  _w_e_e_k_d_a_y_, _d_a_y_, _m_o_n_t_h and _y_e_a_r present.  Example:
  497.             REM Mon Tue Wed Thu Fri 28 Oct 1990 \
  498.                  MSG 1st working day on or after 28 October 1990.
  499.  
  500.        Note that when both _w_e_e_k_d_a_y and _d_a_y are specified,  RReemmiinndd
  501.        chooses the first date on or after the specified _d_a_y which
  502.        also satisfies the _w_e_e_k_d_a_y constraint.  It  does  this  by
  503.        picking the first date on or after the specified _d_a_y which
  504.        is listed in the list of _w_e_e_k_d_a_y_s_.  Thus, a reminder like:
  505.  
  506.             REM Mon Tue 28 Oct 1990 MSG Hi
  507.  
  508.        would  be  issued  only  on  Monday, 29 October, 1990.  It
  509.        would not be issued on Tuesday, 30  October,  1990,  since
  510.        the  29th  is  the  first date to satisfy the _w_e_e_k_d_a_y con-
  511.        straints.
  512.  
  513.        BBAACCKKWWAARRDD SSCCAANNNNIINNGG
  514.  
  515.        Sometimes, it is necessary to specify a date  as  being  a
  516.        set  amount of time before another date.  For example, the
  517.        last Monday in a given month is computed as the first Mon-
  518.        day  in the next month, minus 7 days.  The _b_a_c_k specifica-
  519.        tion in the reminder is used in this case:
  520.  
  521.             REM Mon 1 -7 MSG Last Monday of every month.
  522.  
  523.  
  524.  
  525.  
  526.                          13 October 1993                        8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. REMIND(1)                                               REMIND(1)
  533.  
  534.  
  535.        A _b_a_c_k is specified with one or two dashes followed by  an
  536.        integer.  This causes RReemmiinndd to move "backwards" from what
  537.        would  normally  be  the  trigger  date.   The  difference
  538.        between --7 and -7 will be explained when the OOMMIITT keyword
  539.        is described.
  540.  
  541.        AADDVVAANNCCEE WWAARRNNIINNGG
  542.  
  543.        For some reminders, it is appropriate to  receive  advance
  544.        warning  of  the  event.   For example, you may wish to be
  545.        reminded of someone's birthday several  days  in  advance.
  546.        The _d_e_l_t_a portion of the RREEMM command achieves this.  It is
  547.        specified as one or two "+" signs followed by a number  _n.
  548.        Again,  the difference between the "+" and "++" forms will
  549.        be explained under the OOMMIITT keyword.  RReemmiinndd will  trigger
  550.        the  reminder on computed trigger date, as well as on each
  551.        of the _n days before the event.  Here are some examples:
  552.  
  553.             REM 6 Jan +5 MSG Remind me of birthday 5 days in advance.
  554.  
  555.        The above example would be triggered every 6th of January,
  556.        as well as the 1st through 5th of January.
  557.  
  558.        PPEERRIIOODDIICC RREEMMIINNDDEERRSS
  559.  
  560.        We  have already seen some built-in mechanisms for certain
  561.        types of periodic reminders.  For example, an event occur-
  562.        ring every Wednesday could be specified as:
  563.  
  564.             REM Wed MSG Event!
  565.  
  566.        However, events which do not repeat daily, weekly, monthly
  567.        or yearly require another approach.  The _r_e_p_e_a_t  component
  568.        of  the  RREEMM command fills this need.  To use it, you must
  569.        completely specify  a  date  (year,  month  and  day,  and
  570.        optionally  weekday.)  The _r_e_p_e_a_t component is an asterisk
  571.        followed by a number specifying the repetition  period  in
  572.        days.
  573.  
  574.        For  example, suppose you get paid every second Wednesday,
  575.        and your last payday was Wednesday, 28 October, 1992.  You
  576.        can use:
  577.  
  578.             REM 28 Oct 1992 *14 MSG Payday
  579.  
  580.        This  issues the reminder every 14 days, starting from the
  581.        calculated trigger date.  You can use _d_e_l_t_a and _b_a_c_k  with
  582.        _r_e_p_e_a_t_.  Note, however, that the _b_a_c_k is used only to com-
  583.        pute the initial trigger date;  thereafter,  the  reminder
  584.        repeats  with  the  specified  period.   Similarly, if you
  585.        specify a weekday, it is used only to calculate  the  ini-
  586.        tial date, and does not affect the repetition period.
  587.  
  588.        SSCCAANNFFRROOMM
  589.  
  590.  
  591.  
  592.                          13 October 1993                        9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. REMIND(1)                                               REMIND(1)
  599.  
  600.  
  601.        The  SSCCAANNFFRROOMM  keyword  is for advanced RReemmiinndd programmers
  602.        only, and will be explained in the section "Details  about
  603.        Trigger  Computation"  near  the end of this manual.  Note
  604.        that SSCCAANNFFRROOMM is available only in versions of RReemmiinndd from
  605.        03.00.04 up.
  606.  
  607.        PPRRIIOORRIITTYY
  608.  
  609.        The  PPRRIIOORRIITTYY  keyword must be followed by a number from 0
  610.        to 9999.  It is used in calendar  mode  and  when  sorting
  611.        reminders.   If  two  reminders have the same trigger date
  612.        and time, then they are sorted by priority.  If the PPRRIIOORR--
  613.        IITTYY keyword is not supplied, a default priority of 5000 is
  614.        used.
  615.  
  616.        EEXXPPIIRRYY DDAATTEESS
  617.  
  618.        Some reminders should be issued periodically for a certain
  619.        time,  but  then  expire.  For example, suppose you have a
  620.        class every Friday, and that your  last  class  is  on  11
  621.        December 1992.  You can use:
  622.  
  623.             REM Fri UNTIL 11 Dec 1992 MSG Class today.
  624.  
  625.        Another  example:   Suppose  you  have  jury  duty from 30
  626.        November  1992  until  4  December  1992.   The  following
  627.        reminder  will  issue  the  message every day of your jury
  628.        duty, as well as 2 days ahead of time:
  629.  
  630.             REM 30 Nov 1992 *1 +2 UNTIL 4 Dec 1992 MSG Jury duty
  631.  
  632.        Note that the _r_e_p_e_a_t of *1 is necessary; without  it,  the
  633.        reminder  would be issued only on 30 November (and the two
  634.        days preceding.)
  635.  
  636.        TTHHEE OONNCCEE KKEEYYWWOORRDD
  637.  
  638.        Sometimes, it is necessary to ensure  that  reminders  are
  639.        run  only once on a given day.  For example, if you have a
  640.        reminder which makes a backup of your files every Friday:
  641.  
  642.             REM Fri RUN do_backup
  643.  
  644.        (Here, _d_o___b_a_c_k_u_p is assumed  to  be  a  program  or  shell
  645.        script  which does the work.)  If you run RReemmiinndd from your
  646.        .login script, for example, and log in several  times  per
  647.        day,  the  _d_o___b_a_c_k_u_p program will be run each time you log
  648.        in.   If,  however,  you  use  the  OONNCCEE  keyword  in  the
  649.        reminder,  the  RReemmiinndd  checks the last access date of the
  650.        reminder script.  If it is the same as the  current  date,
  651.        RReemmiinndd  assumes that it has already been run, and will not
  652.        issue reminders containing the OONNCCEE keyword.
  653.  
  654.        Note that if you view or edit your  reminder  script,  the
  655.  
  656.  
  657.  
  658.                          13 October 1993                       10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. REMIND(1)                                               REMIND(1)
  665.  
  666.  
  667.        last  access  date  will  be updated, and the OONNCCEE keyword
  668.        will not operate properly.  If you start RReemmiinndd  with  the
  669.        --oo option, then the OONNCCEE keyword will be ignored.
  670.  
  671.        LLOOCCAALLLLYY OOMMIITTTTIINNGG WWEEEEKKDDAAYYSS
  672.  
  673.        The OOMMIITT portion of the RREEMM command is used to "omit" cer-
  674.        tain days when counting the _d_e_l_t_a or _b_a_c_k.  It  is  speci-
  675.        fied  using  the  keyword OOMMIITT followed by a list of week-
  676.        days.  Its action is best illustrated with examples:
  677.  
  678.             REM 1 +1 OMIT Sat Sun MSG Important Event
  679.  
  680.        This reminder is normally triggered on the first of  every
  681.        month,  as  well as the day preceding it.  However, if the
  682.        first of the month falls on a Sunday or Monday,  then  the
  683.        reminder  is  triggered starting from the previous Friday.
  684.        This is because the _d_e_l_t_a of +1 does not count Saturday or
  685.        Sunday  when  it counts backwards from the trigger date to
  686.        determine how much advance warning to give.
  687.  
  688.        Contrast this with the use of "++1" in the above  command.
  689.        In  this  case,  the reminder is triggered on the first of
  690.        each month, as well as the day preceding it.  The  omitted
  691.        days are counted.
  692.  
  693.             REM 1 -1 OMIT Sat Sun MSG Last working day of month
  694.  
  695.        Again,  in  the  above  example,  the  _b_a_c_k of -1 normally
  696.        causes the trigger date to be the last day of  the  month.
  697.        However,  because  of the OOMMIITT clause, if the first of the
  698.        month falls on a Sunday or Monday,  the  trigger  date  is
  699.        moved  backwards past the weekend to Friday.  (If you have
  700.        globally omitted holidays, the reminder will be moved back
  701.        past   them,  also.   See  "The  OMIT  command"  for  more
  702.        details.)
  703.  
  704.        By comparison, if we had used "--1", the reminder would be
  705.        triggered  on the last day of the month, regardless of the
  706.        OOMMIITT.
  707.  
  708.        TTIIMMEEDD RREEMMIINNDDEERRSS
  709.  
  710.        Timed reminders are those which have an  AATT  keyword  fol-
  711.        lowed by a _t_i_m_e and optional _t_d_e_l_t_a and _t_r_e_p_e_a_t.  The _t_i_m_e
  712.        must be specified in 24-hour format, with 0:00  represent-
  713.        ing  midnight,  12:00  representing noon, and 23:59 repre-
  714.        senting one minute to midnight.   You  can  use  either  a
  715.        colon  or a period to separate the hours from the minutes.
  716.        That is, 13:39 and 13.39 are equivalent.
  717.  
  718.        RReemmiinndd treats timed reminders specially.  If  the  trigger
  719.        date  for a timed reminder is the same as the current sys-
  720.        tem date, the reminder is  queued  for  later  activation.
  721.  
  722.  
  723.  
  724.                          13 October 1993                       11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. REMIND(1)                                               REMIND(1)
  731.  
  732.  
  733.        When  RReemmiinndd has finished processing the reminder file, it
  734.        puts  itself  in  the  background,  and  activates   timed
  735.        reminders when the system time reached the specified time.
  736.  
  737.        If the trigger date is _n_o_t the same as  the  system  date,
  738.        the reminder is not queued.
  739.  
  740.        For example, the following reminder, triggered every work-
  741.        ing day, will emit a  message  telling  you  to  leave  at
  742.        5:00pm:
  743.  
  744.             REM Mon Tue Wed Thu Fri AT 17:00 MSG Time to leave!
  745.  
  746.        The  following reminder will be triggered on Thursdays and
  747.        Fridays, but will only be queued on Fridays:
  748.  
  749.             REM Fri ++1 AT 13:00 MSG Lunch at 1pm Friday.
  750.  
  751.        The _t_d_e_l_t_a and _t_r_e_p_e_a_t have the same form as a _r_e_p_e_a_t  and
  752.        _d_e_l_t_a,  but  are  specified in minutes.  For example, this
  753.        reminder will be triggered at 12:00pm as well as  45  min-
  754.        utes before:
  755.  
  756.             REM AT 12:00 +45 MSG Example
  757.  
  758.        The following will be issued starting at 10:45, every half
  759.        hour until 11:45, and again at noon.
  760.  
  761.             REM AT 12:00 +75 *30 MSG Example2
  762.  
  763.        The "+75" means that the reminder is  issued  starting  75
  764.        minutes  before  noon;  in other words, at 10:45.  The *30
  765.        specifies that the reminder is subsequently to  be  issued
  766.        every 30 minutes.  Note that the reminder is always issued
  767.        at the specified time, even if the _t_d_e_l_t_a is not a  multi-
  768.        ple  of  the  _t_r_e_p_e_a_t.   So the above example is issued at
  769.        10:45am, 11:15am, 11:45am, and 12:00pm.  Note that in  the
  770.        time  specification,  there  is no distinction between the
  771.        "+" and "++" forms of _t_d_e_l_t_a.
  772.  
  773.        Normally, RReemmiinndd will issue timed  reminders  as  it  pro-
  774.        cesses  the  reminder  script, as well as queuing them for
  775.        later.  If you do not want RReemmiinndd to issue  the  reminders
  776.        when  processing  the  script,  but only to queue them for
  777.        later, use the --aa command-line option.  If you do not want
  778.        reminders  to be queued for later, use the --qq command-line
  779.        option.
  780.  
  781.        Normally, RReemmiinndd forks  a  background  process  to  handle
  782.        queued  reminders.   If  you  want RReemmiinndd to remain in the
  783.        foreground, use the --ff command-line option.  This is  use-
  784.        ful,  for  example, in .xinitrc scripts, where you can use
  785.        the command:
  786.  
  787.  
  788.  
  789.  
  790.                          13 October 1993                       12
  791.  
  792.  
  793.  
  794.  
  795.  
  796. REMIND(1)                                               REMIND(1)
  797.  
  798.  
  799.             remind -fa myreminders &
  800.  
  801.        This ensures that when you exit X-Windows, the RReemmiinndd pro-
  802.        cess is killed.
  803.  
  804.        WWAARRNNIINNGG AABBOOUUTT TTIIMMEEDD RREEMMIINNDDEERRSS
  805.  
  806.        Note:   If  you  use  user-defined  functions or variables
  807.        (described later) in the bodies of timed  reminders,  then
  808.        when  the timed reminders are activated, the variables and
  809.        functions have the definitions which were in effect at the
  810.        end  of  the  reminder  script.  These definitions may _n_o_t
  811.        necessarily be those which were in effect at the time  the
  812.        reminder was queued.
  813.  
  814.        TTHHEE SSCCHHEEDD KKEEYYWWOORRDD
  815.  
  816.        The  SSCCHHEEDD  keyword  allows  more precise control over the
  817.        triggering of timed reminders.  However,  discussion  must
  818.        be deferred until after expressions and user-defined func-
  819.        tions are explained.  See the subsection "Precise Schedul-
  820.        ing" further on.
  821.  
  822.  
  823. TTHHEE SSUUBBSSTTIITTUUTTIIOONN FFIILLTTEERR
  824.        Before  being  processed,  the  body  of  a RREEMM command is
  825.        passed through a substitution filter.   The  filter  scans
  826.        for  sequences  "%x"  (where "x" is any letter and certain
  827.        other characters)  and  performs  substitutions  as  shown
  828.        below.   (All  dates  refer  to  the  trigger  date of the
  829.        reminder.)
  830.  
  831.        %%aa     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y _m_o_n_t_h_, _y_e_a_r"
  832.               For example, consider the reminder:
  833.  
  834.               REM 18 Oct 1990 +4 MSG Meeting with Bob %a.
  835.  
  836.               On 16 October 1990, it would  print  "Meeting  with
  837.               Bob on Thursday, 18 October, 1990."
  838.  
  839.               On  17  October  1990, it would print "Meeting with
  840.               Bob tomorrow."
  841.  
  842.               On 18 October 1990, it would  print  "Meeting  with
  843.               Bob today."
  844.  
  845.        %%bb     is replaced with "in _d_i_f_f day's time" where _d_i_f_f is
  846.               the aaccttuuaall number of days between the current  date
  847.               and the trigger date.  (OOMMIITTss have no effect.)
  848.               For example, consider:
  849.  
  850.               REM 18 Oct 1990 +4 MSG Meeting with Bob %b.
  851.  
  852.               On  16  October  1990, it would print "Meeting with
  853.  
  854.  
  855.  
  856.                          13 October 1993                       13
  857.  
  858.  
  859.  
  860.  
  861.  
  862. REMIND(1)                                               REMIND(1)
  863.  
  864.  
  865.               Bob in 2 days' time."
  866.  
  867.               On 17 October 1990, it would  print  "Meeting  with
  868.               Bob tomorrow."
  869.  
  870.               On  18  October  1990, it would print "Meeting with
  871.               Bob today."
  872.  
  873.        %%cc     is replaced with "on _w_e_e_k_d_a_y"
  874.               Example: REM 18 Oct 1990 +4 MSG  Meeting  with  Bob
  875.               %c.
  876.  
  877.               On  16  October  1990, it would print "Meeting with
  878.               Bob on Thursday."
  879.  
  880.               On 17 October 1990, it would  print  "Meeting  with
  881.               Bob tomorrow."
  882.  
  883.               On  18  October  1990, it would print "Meeting with
  884.               Bob today."
  885.  
  886.        %%dd     is replaced with "_d_a_y", the day of the month.
  887.  
  888.        %%ee     is replaced with "on _d_d_/_m_m_/_y_y_y_y"
  889.  
  890.        %%ff     is replaced with "on _m_m_/_d_d_/_y_y_y_y"
  891.  
  892.        %%gg     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y _m_o_n_t_h"
  893.  
  894.        %%hh     is replaced with "on _d_d_/_m_m"
  895.  
  896.        %%ii     is replaced with "on _m_m_/_d_d"
  897.  
  898.        %%jj     is replaced with "on _w_e_e_k_d_a_y_, _m_o_n_t_h  _d_a_y_-_t_h_,  _y_e_a_r"
  899.               This  form  appends the characters "st", "nd", "rd"
  900.               or "th" to the day of the month, as appropriate.
  901.  
  902.        %%kk     is replaced with "on _w_e_e_k_d_a_y_, _m_o_n_t_h _d_a_y_-_t_h"
  903.  
  904.        %%ll     is replaced with "on _y_y_y_y_/_m_m_/_d_d"
  905.  
  906.        %%mm     is replaced with "_m_o_n_t_h", the name of the month.
  907.  
  908.        %%nn     is replaced with the number (1 to 12) of the month.
  909.  
  910.        %%oo     is replaced with " (today)" if and only if the cur-
  911.               rent system date is the same as the date being used
  912.               by RReemmiinndd as the current date.  Recall that you can
  913.               specify a date for RReemmiinndd to  use  on  the  command
  914.               line.  This substitution is not generally useful in
  915.               a RREEMM command, but is useful in a  BBAANNNNEERR  command.
  916.               (See "The BANNER Command.")
  917.  
  918.        %%pp     is  replaced  with  "s"  if  the  _d_i_f_f  between the
  919.  
  920.  
  921.  
  922.                          13 October 1993                       14
  923.  
  924.  
  925.  
  926.  
  927.  
  928. REMIND(1)                                               REMIND(1)
  929.  
  930.  
  931.               current date and the trigger date is  not  1.   You
  932.               can use this to construct reminders like:
  933.               REM 1 Jan +4 MSG %x day%p to go before New Year!
  934.  
  935.        %%qq     is replaced with "'s" if the _d_i_f_f between the trig-
  936.               ger date and the current date is 1.  Otherwise,  it
  937.               is replaced with "s'"  This can be used as follows:
  938.               REM 1 Jan +4 MSG New Year in %x day%q time!
  939.  
  940.        %%rr     is replaced with the day of the month  (01  to  31)
  941.               padded  with a leading zero if needed to pad to two
  942.               digits.
  943.  
  944.        %%ss     is replaced with "st", "nd", "rd" or "th" depending
  945.               on the day of the month.
  946.  
  947.        %%tt     is replaced with the number of the month (01 to 12)
  948.               padded to two digits with a leading zero.
  949.  
  950.        %%uu     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y_-_t_h  _m_o_n_t_h_,  _y_e_a_r"
  951.               This  is similar to %%aa except that "st", "nd", "rd"
  952.               or "th" is added to the _d_a_y as appropriate.
  953.  
  954.        %%vv     is replaced with "on _w_e_e_k_d_a_y_, _d_a_y_-_t_h _m_o_n_t_h"
  955.  
  956.        %%ww     is replaced with "_w_e_e_k_d_a_y", the name of the day  of
  957.               the week.
  958.  
  959.        %%xx     is  replaced with the _d_i_f_f between the current date
  960.               and the trigger date.  The _d_i_f_f is defined  as  the
  961.               actual  number  of  days  between  these two dates;
  962.               OOMMIITTss are not counted.  (Strict date subtraction is
  963.               performed.)
  964.  
  965.        %%yy     is  replaced  with  "_y_e_a_r", the year of the trigger
  966.               date.
  967.  
  968.        %%zz     is replaced with "_y_y", the last two digits  of  the
  969.               year.
  970.  
  971.        %%__     (percent-underscore)  is  replaced  with a newline.
  972.               You can use this to achieve multi-line reminders.
  973.  
  974.        %%11     is replaced with "now", "_m minutes  from  now",  "_m
  975.               minutes ago", "_h hours from now", "_h hours ago", "_h
  976.               hours and _m minutes from now" or  "_h  hours  and  _m
  977.               minutes  ago", as appropriate for a timed reminder.
  978.               Note that unless you specify the --aa  option,  timed
  979.               reminders  will be triggered like normal reminders,
  980.               and thus a timed reminder which occurred earlier in
  981.               the day may be triggered.  This causes the need for
  982.               the "...ago" forms.
  983.  
  984.        %%22     is replaced with "at _h_h:_m_mam" or  "..pm"  depending
  985.  
  986.  
  987.  
  988.                          13 October 1993                       15
  989.  
  990.  
  991.  
  992.  
  993.  
  994. REMIND(1)                                               REMIND(1)
  995.  
  996.  
  997.               on the AATT time of the reminder.
  998.  
  999.        %%33     is replaced with "at _h_h:_m_m" in 24-hour format.
  1000.  
  1001.        %%44     is  replaced  with  "_m_m"  where _m_m is the number of
  1002.               minutes between "now" and the time specified by AATT.
  1003.               If  the  AATT  time is earlier than the current time,
  1004.               then the result is negative.
  1005.  
  1006.        %%55     is replaced with "_m_a"  where  _m_a  is  the  absolute
  1007.               value of the number produced by %%44.
  1008.  
  1009.        %%66     is  replaced with "ago" or "from now", depending on
  1010.               the relationship between the AATT time and  the  cur-
  1011.               rent time.
  1012.  
  1013.        %%77     is replaced with the number of hours between the AATT
  1014.               time and the  current  time.   It  is  always  non-
  1015.               negative.
  1016.  
  1017.        %%88     is  replaced with the number of minutes between the
  1018.               AATT time and the current time, after the hours  (%%77)
  1019.               have been subtracted out.  This is a number ranging
  1020.               from 0 to 59.
  1021.  
  1022.        %%99     is replaced with "s" if the value produced by %%88 is
  1023.               not 1.
  1024.  
  1025.        %%00     is replaced with "s" if the value produced by %%77 is
  1026.               not 1.
  1027.  
  1028.        %%!!     is replaced with "is" if the current time is before
  1029.               the AATT time, or "was" if it is after.
  1030.  
  1031.        %%@@     is similar to %%22 but displays the current time.
  1032.  
  1033.        %%##     is similar to %%33 but displays the current time.
  1034.  
  1035.        %%""     (percent-doublequote) is removed.  This sequence is
  1036.               not used by the substitution filter, but is used to
  1037.               tell  RReemmiinndd  which  text  to include in a calendar
  1038.               entry when the --cc, --ss or --pp option is chosen.   See
  1039.               "Calendar Mode"
  1040.  
  1041.        Notes:
  1042.  
  1043.        o      RReemmiinndd  normally  prints  a  blank  line after each
  1044.               reminder; if the last character of the body is "%",
  1045.               the blank line will not be printed.
  1046.  
  1047.        o      Substitutions  a,  b,  c, e, f, g, h, i, j, k, l, u
  1048.               and v all are replaced with "today" if the  current
  1049.               date  equals the trigger date, or "tomorrow" if the
  1050.               trigger date is one day  after  the  current  date.
  1051.  
  1052.  
  1053.  
  1054.                          13 October 1993                       16
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060. REMIND(1)                                               REMIND(1)
  1061.  
  1062.  
  1063.               Thus,  they are nnoott the same as substitutions built
  1064.               up from the simpler %w, %y, etc.  sequences.
  1065.  
  1066.        o      Any of  the  substitutions  dealing  with  time  (0
  1067.               through  9  and  '!')  produce undefined results if
  1068.               used in a reminder which does not have an  AATT  key-
  1069.               word.   Also,  if a reminder has a _d_e_l_t_a and may be
  1070.               triggered on several days, the  time  substitutions
  1071.               ignore  the  date.   Thus,  the %%11 substitution may
  1072.               report that a meeting is in 15 minutes,  for  exam-
  1073.               ple,  even  though  it  may only be in 2 days time,
  1074.               because a _d_e_l_t_a has triggered the reminder.  It  is
  1075.               recommended  that  you  use  the time substitutions
  1076.               only in timed reminders with  no  _d_e_l_t_a  which  are
  1077.               designed to be queued for timed activation.
  1078.  
  1079.        o      Capital  letters  can  be  used in the substitution
  1080.               sequence, in which case the first character of  the
  1081.               substituted  string  is  capitalized (if it is nor-
  1082.               mally a lower-case letter.)
  1083.  
  1084.        o      All other characters following a "%" sign are  sim-
  1085.               ply  copied.  In particular, to get a "%" sign out,
  1086.               use "%%" in the body.   To  start  the  body  of  a
  1087.               reminder  with a space, use "% ", since RReemmiinndd nor-
  1088.               mally scans for the first non-space character after
  1089.               a MMSSGG,, CCAALL or RRUUNN token.
  1090.  
  1091. TTHHEE OOMMIITT CCOOMMMMAANNDD
  1092.        In addition to being a keyword in the RREEMM command, OOMMIITT is
  1093.        a command in its own right.  Its syntax is:
  1094.  
  1095.               OOMMIITT _d_a_y _m_o_n_t_h [_y_e_a_r]
  1096.  
  1097.        The OOMMIITT command is used to "globally" omit certain  days,
  1098.        which  are  usually holidays.  These globally-omitted days
  1099.        are skipped by the "-" and "+" forms of  _b_a_c_k  and  _d_e_l_t_a.
  1100.        Some examples:
  1101.  
  1102.             OMIT 1 Jan
  1103.             OMIT 7 Sep 1992
  1104.  
  1105.        The  first example specifies a holiday which occurs on the
  1106.        same date each year - New Year's Day.  The second  example
  1107.        specifies  a holiday which changes each year - Labour Day.
  1108.        For these types of holidays, you must create an OOMMIITT  com-
  1109.        mand for each year.  (Later, in the description of expres-
  1110.        sions and some of the more advanced  features  of  RReemmiinndd,
  1111.        you will see how to automate this for some cases.)
  1112.  
  1113.        For  convenience,  you can use a _d_e_l_t_a and MMSSGG or RRUUNN key-
  1114.        word in the OOMMIITT command.   The  following  sequences  are
  1115.        exactly equivalent:
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                          13 October 1993                       17
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126. REMIND(1)                                               REMIND(1)
  1127.  
  1128.  
  1129.             OMIT 1 Jan
  1130.             REM 1 Jan +4 MSG New year's day is %b!
  1131.  
  1132.             and
  1133.  
  1134.             OMIT 1 Jan +4 MSG New year's day is %b!
  1135.  
  1136.        TTHHEE BBEEFFOORREE,, AAFFTTEERR AANNDD SSKKIIPP KKEEYYWWOORRDDSS
  1137.  
  1138.        Normally, days which are omitted, whether by a global OOMMIITT
  1139.        command or the local OOMMIITT keyword in a RREEMM statement, only
  1140.        affect the counting of the -_b_a_c_k or the +_d_e_l_t_a.  For exam-
  1141.        ple, suppose you have a meeting every Wednesday.  Suppose,
  1142.        too, that you have indicated 11 Nov as a holiday:
  1143.  
  1144.             OMIT 11 Nov +4 MSG Remembrance Day
  1145.             REM Wed +1 MSG Code meeting %b.
  1146.  
  1147.        The  above  sequence will issue a reminder about a meeting
  1148.        for 11 November 1992, which is a Wednesday.  This is prob-
  1149.        ably incorrect.  There are three options:
  1150.  
  1151.        BBEEFFOORREE This keyword moves the reminder to before any omit-
  1152.               ted days.  Thus,  in  the  above  example,  use  of
  1153.               BBEEFFOORREE would cause the meeting reminder to be trig-
  1154.               gered on Tuesday, 10 November 1992.
  1155.  
  1156.        AAFFTTEERR  This keyword moves the reminder to after any  omit-
  1157.               ted  days.   In  the  above  example,  the  meeting
  1158.               reminder would be triggered on Thursday, 12  Novem-
  1159.               ber 1992.
  1160.  
  1161.        SSKKIIPP   This keyword causes the reminder to be skipped com-
  1162.               pletely on any omitted days.  Thus,  in  the  above
  1163.               example,  the reminder would not be triggered on 11
  1164.               November 1992.  However, it would be  triggered  as
  1165.               usual on the following Wednesday, 18 November 1992.
  1166.  
  1167.        The BBEEFFOORREE and AAFFTTEERR keywords move the trigger date  of  a
  1168.        reminder  to  before  or  after  a  block of omitted days,
  1169.        respectively.  Suppose you normally run a  backup  on  the
  1170.        first  day of the month.  However, if the first day of the
  1171.        month is a weekend or holiday, you run the backup  on  the
  1172.        first  working  day following the weekend or holiday.  You
  1173.        could use:
  1174.  
  1175.             REM 1 OMIT Sat Sun AFTER RUN do_backup
  1176.  
  1177.        Let's examine how the trigger date  is  computed.   The  11
  1178.        specifies the first day of the month.  The local OOMMIITT key-
  1179.        word causes the AAFFTTEERR keyword to move the reminder forward
  1180.        past  weekends.  Finally, the AAFFTTEERR keyword will keep mov-
  1181.        ing the reminder forward until it has passed any  holidays
  1182.        specified with global OOMMIITT commands.
  1183.  
  1184.  
  1185.  
  1186.                          13 October 1993                       18
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192. REMIND(1)                                               REMIND(1)
  1193.  
  1194.  
  1195. TTHHEE IINNCCLLUUDDEE CCOOMMMMAANNDD
  1196.        RReemmiinndd  allows you to include other files in your reminder
  1197.        script, similar to the C preprocessor #include  directive.
  1198.        For example, your system administrator may maintain a file
  1199.        of holidays or system-wide  reminders.   You  can  include
  1200.        these in your reminder script as follows:
  1201.  
  1202.             INCLUDE /usr/share/remind/holidays
  1203.             INCLUDE /usr/share/remind/reminders
  1204.  
  1205.        (The  actual  pathnames  vary  from system to system - ask
  1206.        your system administrator.)
  1207.  
  1208.        IINNCCLLUUDDEE files can be nested up to a depth of 8.
  1209.  
  1210.        If you specify a filename of "-" in the  IINNCCLLUUDDEE  command,
  1211.        RReemmiinndd will begin reading from standard input.
  1212.  
  1213. TTHHEE RRUUNN CCOOMMMMAANNDD
  1214.        If  you  include  other files in your reminder script, you
  1215.        may not always entirely "trust" the contents of the  other
  1216.        files.   For  example, they may contain RRUUNN-type reminders
  1217.        which could be used to access your files or perform  unde-
  1218.        sired actions.  The RRUUNN command can restrict this:  If you
  1219.        include the command RRUUNN OOFFFF  in  your  top-level  reminder
  1220.        script,  any  reminder  or expression which would normally
  1221.        execute a system command is disabled.   RRUUNN  OONN  will  re-
  1222.        enable  the  execution  of system commands.  Note that the
  1223.        RRUUNN OONN command can _o_n_l_y be used in your top-level reminder
  1224.        script;  it  will  _n_o_t  work  in any files accessed by the
  1225.        IINNCCLLUUDDEE command.  This is  to  protect  you  from  someone
  1226.        placing  a  RRUUNN  OONN command in an included file.  However,
  1227.        the RRUUNN OOFFFF command can be used at  top  level  or  in  an
  1228.        included file.
  1229.  
  1230.        If  you  run  RReemmiinndd with the --rr command-line option, RRUUNN-
  1231.        type reminders and the sshheellll(()) function will be  disabled,
  1232.        regardless  of  any  RRUUNN  commands in the reminder script.
  1233.        However, any command supplied  with  the  --kk  option  will
  1234.        still be executed.
  1235.  
  1236.        One  use  of the RRUUNN command is to provide a secure inter-
  1237.        face between RReemmiinndd and the EEllmm mail system.  The EEllmm sys-
  1238.        tem  can  automatically scan incoming mail for reminder or
  1239.        calendar entries, and place them in  your  calendar  file.
  1240.        To  use this feature, you should set the calendar filename
  1241.        option under EEllmm to be something  like  "~/.reminders.in",
  1242.        _n_o_t  your  main reminder file!  This is so that any RRUUNN OONN
  1243.        commands mailed to you can never be activated.
  1244.  
  1245.        Then, you can  use  the  EEllmm  _s_c_a_n  _m_e_s_s_a_g_e  _f_o_r  _c_a_l_e_n_d_a_r
  1246.        _e_n_t_r_i_e_s  command  to place reminders prefaced by "->" into
  1247.        .reminders.in.  In your main .reminders file, include  the
  1248.        following lines:
  1249.  
  1250.  
  1251.  
  1252.                          13 October 1993                       19
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258. REMIND(1)                                               REMIND(1)
  1259.  
  1260.  
  1261.             RUN OFF   # Disable RUN
  1262.             INCLUDE .reminders.in
  1263.             RUN ON    # Re-enable RUN
  1264.  
  1265.  
  1266. TTHHEE BBAANNNNEERR CCOOMMMMAANNDD
  1267.        When  RReemmiinndd  first issues a reminder, it prints a message
  1268.        like this:
  1269.  
  1270.             Reminders for Friday, 30th October, 1992 (today):
  1271.  
  1272.        (The banner  is  not  printed  if  any  of  the  calendar-
  1273.        producing options is used, or if the --kk option is used.)
  1274.  
  1275.        The  BBAANNNNEERR command lets you change the format.  It should
  1276.        appear before any RREEMM commands.  The format is:
  1277.  
  1278.               BBAANNNNEERR _f_o_r_m_a_t
  1279.  
  1280.        The _f_o_r_m_a_t is similar to the _b_o_d_y of a RREEMM command.  It is
  1281.        passed  through  the substitution filter, with an implicit
  1282.        trigger of the current system  date.   Thus,  the  default
  1283.        banner is equivalent to:
  1284.  
  1285.             BANNER Reminders for %w, %d%s %m, %y%o:
  1286.  
  1287.        You  can  disable the banner completely with BANNER %.  Or
  1288.        you can create a custom banner:
  1289.  
  1290.             BANNER Hi - here are your reminders for %y/%t/%r:
  1291.  
  1292. CCOONNTTRROOLLLLIINNGG TTHHEE OOMMIITT CCOONNTTEEXXTT
  1293.        Sometimes, it  is  necessary  to  temporarily  change  the
  1294.        global  OOMMIITTss  which  are  in  force  for a few reminders.
  1295.        Three commands allow you to do this:
  1296.  
  1297.        PPUUSSHH--OOMMIITT--CCOONNTTEEXXTT
  1298.               This command saves the current global OOMMIITTss  on  an
  1299.               internal stack.
  1300.  
  1301.        CCLLEEAARR--OOMMIITT--CCOONNTTEEXXTT
  1302.               This command clears all of the global OOMMIITTss, start-
  1303.               ing you off with a "clean slate."
  1304.  
  1305.        PPOOPP--OOMMIITT--CCOONNTTEEXXTT
  1306.               This command restores the global OOMMIITTss  which  were
  1307.               saved by the most recent PPUUSSHH--OOMMIITT--CCOONNTTEEXXTT.
  1308.  
  1309.        For  example,  suppose you have a block of reminders which
  1310.        require a clear OOMMIITT context, and that they also introduce
  1311.        unwanted  global  OOMMIITTss  which  could interfere with later
  1312.        reminders.  You could use the following fragment:
  1313.  
  1314.             PUSH-OMIT-CONTEXT   # Save the current context
  1315.  
  1316.  
  1317.  
  1318.                          13 October 1993                       20
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324. REMIND(1)                                               REMIND(1)
  1325.  
  1326.  
  1327.             CLEAR-OMIT-CONTEXT  # Clean the slate
  1328.             # Block of reminders goes here
  1329.             POP-OMIT-CONTEXT    # Restore the saved omit context
  1330.  
  1331. EEXXPPRREESSSSIIOONNSS
  1332.        In certain contexts, to be described  later,  RReemmiinndd  will
  1333.        accept  expressions  for  evaluation.   RReemmiinndd expressions
  1334.        resemble C expressions, but operate on different types  of
  1335.        objects.
  1336.  
  1337.        DDAATTAA TTYYPPEESS
  1338.  
  1339.        RReemmiinndd expressions understand four types of objects:
  1340.  
  1341.        IINNTT    The  IINNTT  data type consists of the integers repre-
  1342.               sentable in one machine word.  The  IINNTT  data  type
  1343.               corresponds to the C "int" type.
  1344.  
  1345.        SSTTRRIINNGG The SSTTRRIINNGG data type consists of strings of charac-
  1346.               ters.  It is somewhat comparable to a  C  character
  1347.               array,  but  more closely resembles the string type
  1348.               in BASIC.
  1349.  
  1350.        TTIIMMEE   The TTIIMMEE data type consists of times  of  the  day.
  1351.               The TTIIMMEE data type is internally stored as an inte-
  1352.               ger representing the number of minutes  since  mid-
  1353.               night.
  1354.  
  1355.        DDAATTEE   The  DDAATTEE data type consists of dates (later than 1
  1356.               January 1990.)  Internally, DDAATTEE objects are stored
  1357.               as the number of days since 1 January 1990.
  1358.  
  1359.        CCOONNSSTTAANNTTSS
  1360.  
  1361.        The  following  examples  illustrate  constants  in RReemmiinndd
  1362.        expressions:
  1363.  
  1364.        IINNTT ccoonnssttaannttss
  1365.               12, 36, -10, 0, 1209
  1366.  
  1367.        SSTTRRIINNGG ccoonnssttaannttss
  1368.               "Hello there", "This is a test", "\n\gosd\w", ""
  1369.  
  1370.               Note that the empty string is  represented  by  "",
  1371.               and  that  backslashes  in  a string are _n_o_t inter-
  1372.               preted specially, as in they are in C.
  1373.  
  1374.        TTIIMMEE ccoonnssttaannttss
  1375.               12:33, 0:01, 14:15, 16:42, 12.16, 13.00, 1.11
  1376.  
  1377.               Note that TTIIMMEE constants  are  written  in  24-hour
  1378.               format.   Either the period or colon can be used to
  1379.               separate the  minutes  from  the  hours.   However,
  1380.               Remind  will  consistently  output times using only
  1381.  
  1382.  
  1383.  
  1384.                          13 October 1993                       21
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390. REMIND(1)                                               REMIND(1)
  1391.  
  1392.  
  1393.               one separator  character.   (The  output  separator
  1394.               character is chosen at compile-time.)
  1395.  
  1396.        DDAATTEE ccoonnssttaannttss
  1397.               DDAATTEE  constants  are  expressed  as 'yyyy/mm/dd' or
  1398.               'yyyy-mm-dd', and the single quotes  _m_u_s_t  be  sup-
  1399.               plied.   This  distinguishes  date  constants  from
  1400.               division or subtraction of integers.  Examples:
  1401.  
  1402.               '1993/02/22', '1992-12-25', '1999/01/01'
  1403.  
  1404.               Note that DDAATTEE constants are  _p_r_i_n_t_e_d  without  the
  1405.               quotes.   Although either '-' or '/' is accepted as
  1406.               a date separator on input, when dates are  printed,
  1407.               only  one  will  be used.  The choice of whether to
  1408.               use '-' or '/' is made at compile-time.  Note  also
  1409.               that  versions  of RReemmiinndd prior to 03.00.01 did not
  1410.               support date constants.   In  those  versions,  you
  1411.               must create dates using the ddaattee(()) function.  Also,
  1412.               versions prior to 03.00.02 did not support the  '-'
  1413.               date separator.
  1414.  
  1415.        OOPPEERRAATTOORRSS
  1416.  
  1417.        RReemmiinndd has the following operators.  Operators on the same
  1418.        line have equal precedence, while operators on lower lines
  1419.        have  lower  precedence  than  those on higher lines.  The
  1420.        operators approximately correspond to C operators.
  1421.  
  1422.             !  -     (unary logical negation and arithmetic negation)
  1423.             *  /  %
  1424.             +  -
  1425.             <  <=  >  >=
  1426.             ==  !=
  1427.             &&
  1428.             ||
  1429.  
  1430.        DDEESSCCRRIIPPTTIIOONN OOFF OOPPEERRAATTOORRSS
  1431.  
  1432.  
  1433.        !!      Logical negation.  Can be applied to an  IINNTT  type.
  1434.               If  the  operand is non-zero, returns zero.  Other-
  1435.               wise, returns 1.
  1436.  
  1437.        --      Unary minus.  Can be applied to  an  IINNTT.   Returns
  1438.               the negative of the operand.
  1439.  
  1440.        **      Multiplication.  Returns the product of two IINNTTs.
  1441.  
  1442.        //      Integer  division.   Returns  the  quotient  of two
  1443.               IINNTTs, discarding the remainder.
  1444.  
  1445.        %%      Modulus.  Returns the remainder upon  dividing  one
  1446.               IINNTT by another.
  1447.  
  1448.  
  1449.  
  1450.                          13 October 1993                       22
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456. REMIND(1)                                               REMIND(1)
  1457.  
  1458.  
  1459.        ++      Has several uses.  These are:
  1460.  
  1461.               IINNTT + IINNTT - returns the sum of two IINNTTs.
  1462.  
  1463.               IINNTT  + TTIIMMEE or TTIIMMEE + IINNTT - returns a TTIIMMEE obtained
  1464.               by adding IINNTT minutes to the original TTIIMMEE.
  1465.  
  1466.               IINNTT + DDAATTEE or DDAATTEE + IINNTT - returns a DDAATTEE  obtained
  1467.               by adding IINNTT days to the original DDAATTEE.
  1468.  
  1469.               SSTTRRIINNGG  +  SSTTRRIINNGG  -  returns a SSTTRRIINNGG which is the
  1470.               concatenation of the two original SSTTRRIINNGGs.
  1471.  
  1472.               SSTTRRIINNGG + anything or anything + SSTTRRIINNGG  -  converts
  1473.               the  non-SSTTRRIINNGG argument to a SSTTRRIINNGG, and then per-
  1474.               forms concatenation.  See the ccooeerrccee(()) function.
  1475.  
  1476.        --      Has several uses.  These are:
  1477.  
  1478.               IINNTT - IINNTT - returns the difference of two IINNTTs.
  1479.  
  1480.               DDAATTEE - DDAATTEE - returns (as an IINNTT) the difference in
  1481.               days between two DDAATTEEs.
  1482.  
  1483.               TTIIMMEE - TTIIMMEE - returns (as an IINNTT) the difference in
  1484.               minutes between two TTIIMMEEs.
  1485.  
  1486.               DDAATTEE - IINNTT - returns a DDAATTEE which is IINNTT days  ear-
  1487.               lier than the original DDAATTEE.
  1488.  
  1489.               TTIIMMEE  -  IINNTT  - returns a TTIIMMEE which is IINNTT minutes
  1490.               earlier than the original TTIIMMEE.
  1491.  
  1492.        <<,, <<==,, >>,, aanndd >>==
  1493.               These are the comparison operators.  They can  take
  1494.               operands  of any type, but both operands must be of
  1495.               the same type.  The comparison operators  return  1
  1496.               if  the  comparison  is  true, or 0 if it is false.
  1497.               Note that string comparison is done  following  the
  1498.               lexical  ordering of characters on your system, and
  1499.               that upper and lower case _a_r_e  distinct  for  these
  1500.               operators.
  1501.  
  1502.        ====,, !!== ==  tests for equality, returning 1 if its operands
  1503.               are equal, and 0 if they are  not.   !=  tests  for
  1504.               inequality.
  1505.  
  1506.               If  the  operands  are  not  of  the  same type, ==
  1507.               returns 0 and != returns 1.  Again, string  compar-
  1508.               isons are case-sensitive.
  1509.  
  1510.        &&&&     This  is  the  logical  AND  operator.  Both of its
  1511.               operands must be of type IINNTT.  It returns 1 if both
  1512.               operands are non-zero, and 0 otherwise.
  1513.  
  1514.  
  1515.  
  1516.                          13 October 1993                       23
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522. REMIND(1)                                               REMIND(1)
  1523.  
  1524.  
  1525.        ||||     This  is  the  logical  OR  operator.   Both of its
  1526.               operands must be of type  IINNTT.   It  returns  1  if
  1527.               either operand is non-zero, and 0 otherwise.
  1528.  
  1529.        NNOOTTEESS
  1530.  
  1531.        Operators  of  equal  precedence are _a_l_w_a_y_s evaluated from
  1532.        left to right, except where parentheses dictate otherwise.
  1533.        This is important, because the enhanced "+" and "-" opera-
  1534.        tors are not necessarily associative.  For example:
  1535.  
  1536.             1 + 2 + "string" + 3 + 4  yields "3string34"
  1537.             1 + (2 + "string") + (3 + 4)  yields "12string7"
  1538.             12:59 + 1 + "test"  yields "13:00test"
  1539.             12:59 + (1 + "test")  yields "12:591test"
  1540.  
  1541.        The logical  operators  are  _n_o_t  so-called  short-circuit
  1542.        operators,  as  they  are  in C.  Both operands are always
  1543.        evaluated.  Thus, an expression such as:
  1544.  
  1545.             (f!=0) && (100/f <= 3)
  1546.  
  1547.        will cause an error if f is zero.
  1548.  
  1549.        VVAARRIIAABBLLEESS
  1550.  
  1551.        RReemmiinndd allows you to assign values to variables.  The  SSEETT
  1552.        command is used as follows:
  1553.  
  1554.        SSEETT _v_a_r _e_x_p_r
  1555.  
  1556.        _V_a_r  is the name of a variable.  It must start with a let-
  1557.        ter or underscore, and consist only of letters, digits and
  1558.        underscores.   Only  the first 12 characters of a variable
  1559.        name are significant.  Variable names are _n_o_t case  sensi-
  1560.        tive;  thus,  "Afoo"  and  "afOo"  are  the same variable.
  1561.        Examples:
  1562.  
  1563.             SET a 10 + (9*8)
  1564.             SET b "This is a test"
  1565.             SET mydir getenv("HOME")
  1566.             SET time 12:15
  1567.             SET date today()
  1568.  
  1569.        Note that variables themselves have no type.  They take on
  1570.        the type of whatever you store in them.
  1571.  
  1572.        To delete a variable, use the UUNNSSEETT command:
  1573.  
  1574.        UUNNSSEETT _v_a_r [_v_a_r...]
  1575.  
  1576.        For  example,  to delete all the variables declared above,
  1577.        use:
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                          13 October 1993                       24
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588. REMIND(1)                                               REMIND(1)
  1589.  
  1590.  
  1591.             UNSET a b mydir time date
  1592.  
  1593.        SSYYSSTTEEMM VVAARRIIAABBLLEESS
  1594.  
  1595.        In addition to the regular user variables, RReemmiinndd has sev-
  1596.        eral "system variables" which are used to query or control
  1597.        the operating  state  of  RReemmiinndd.   System  variables  are
  1598.        available starting from version 03.00.07 of RReemmiinndd.
  1599.  
  1600.        All  system  variables begin with a dollar sign '$'.  They
  1601.        can be used in SSEETT commands and expressions just as  regu-
  1602.        lar  variables can.  All system variables always hold val-
  1603.        ues of a specified type.  In addition, some  system  vari-
  1604.        ables cannot be modified, and you cannot create new system
  1605.        variables.  System variables can  be  initialized  on  the
  1606.        command line with the --ii option, but you may need to quote
  1607.        them to avoid having the shell interpret the dollar  sign.
  1608.        System variable names are not case-sensitive.
  1609.  
  1610.        The  following system variables are defined.  Those marked
  1611.        "read-only" cannot be changed with the SSEETT  command.   All
  1612.        system variables hold values of type IINNTT, unless otherwise
  1613.        specified.
  1614.  
  1615.        $$CCaallccUUTTCC
  1616.               If 1 (the default),  then  RReemmiinndd  uses  C  library
  1617.               functions   to  calculate  the  number  of  minutes
  1618.               between local and Universal Time Coordinated.  This
  1619.               affects  astronomical  calculations  (ssuunnrriissee(()) for
  1620.               example.)  If 0, then you must supply the number of
  1621.               minutes  between  local  and Universal Time Coordi-
  1622.               nated in the $$MMiinnssFFrroommUUTTCC system variable.
  1623.  
  1624.        $$CCaallMMooddee ((rreeaadd--oonnllyy))
  1625.               If non-zero, then the --cc option was supplied on the
  1626.               command line.
  1627.  
  1628.        $$DDaaeemmoonn ((rreeaadd--oonnllyy))
  1629.               If  the  daemon  mode  --zz was invoked, contains the
  1630.               number of minutes between wakeups.  If not  running
  1631.               in  daemon  mode,  contains 0.  For the MS-DOS ver-
  1632.               sion, always contains 0.
  1633.  
  1634.        $$DDoonnttFFoorrkk ((rreeaadd--oonnllyy))
  1635.               If non-zero, then the --cc option was supplied on the
  1636.               command  line.  For the MS-DOS version, always con-
  1637.               tains 1.
  1638.  
  1639.        $$DDoonnttTTrriiggAAttss ((rreeaadd--oonnllyy))
  1640.               If non-zero, then the --aa option was supplied on the
  1641.               command  line.  For the MS-DOS version, always con-
  1642.               tains 0.
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                          13 October 1993                       25
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654. REMIND(1)                                               REMIND(1)
  1655.  
  1656.  
  1657.        $$DDoonnttQQuueeuuee ((rreeaadd--oonnllyy))
  1658.               If non-zero, then the --qq option was supplied on the
  1659.               command  line.  For the MS-DOS version, always con-
  1660.               tains 1.
  1661.  
  1662.        $$EEnnddSSeenntt ((SSTTRRIINNGG ttyyppee))
  1663.               Contains a list of characters which end a sentence.
  1664.               The  MMSSFF  keyword  inserts  two  spaces after these
  1665.               characters.  Initially, $$EEnnddSSeenntt is  set  to  ".!?"
  1666.               (period, exclamation mark, and question mark.)
  1667.  
  1668.        $$EEnnddSSeennttIIgg ((SSTTRRIINNGG ttyyppee))
  1669.               Contains  a  list  of  characters  which  should be
  1670.               ignored when MMSSFF decides whether or  not  to  place
  1671.               two  spaces after a sentence.  Initially, is set to
  1672.               "'>)]}"+CHAR(34) (single-quote, greater-than, right
  1673.               parenthesis,  right  bracket, right brace, and dou-
  1674.               ble-quote.)
  1675.  
  1676.               For example, the default values work as follows:
  1677.  
  1678.                    MSF He said, "Huh! (Two spaces will follow this.)"  Yup.
  1679.  
  1680.               because the final parenthesis and quote are ignored
  1681.               (for  the  purposes  of spacing) when they follow a
  1682.               period.
  1683.  
  1684.        $$FFiirrssttIInnddeenntt
  1685.               The number of spaces by which to indent  the  first
  1686.               line of a MMSSFF-type reminder.  The default is 0.
  1687.  
  1688.        $$FFoollddYYeeaarr
  1689.               The standard Unix library functions may have diffi-
  1690.               culty dealing with dates later than 2037.  If  this
  1691.               variable  is  set  to  1, then the UTC calculations
  1692.               "fold back" years later than 2037 before using  the
  1693.               Unix  library  functions.  For example, to find out
  1694.               whether or not daylight savings time is  in  effect
  1695.               in  June,  2077, the year is "folded back" to 2010,
  1696.               because both years begin on a Monday, and both  are
  1697.               non-leapyears.  The rules for daylight savings time
  1698.               are thus presumed to be identical for  both  years,
  1699.               and the Unix library functions can handle 2010.  By
  1700.               default, this variable is 0.  Set it to  1  if  the
  1701.               sun  or  UTC  functions misbehave for years greater
  1702.               than 2037.
  1703.  
  1704.        $$FFoorrmmWWiiddtthh
  1705.               The maximum width of each line of text for  format-
  1706.               ting MMSSFF-type reminders.  The default is 72.  If an
  1707.               MMSSFF-type reminder contains a word too long  to  fit
  1708.               in this width, it will not be truncated - the width
  1709.               limit will be ignored.
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                          13 October 1993                       26
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720. REMIND(1)                                               REMIND(1)
  1721.  
  1722.  
  1723.        $$HHuusshhMMooddee ((rreeaadd--oonnllyy))
  1724.               If non-zero, then the --hh option was supplied on the
  1725.               command line.
  1726.  
  1727.        $$IIggnnoorreeOOnnccee ((rreeaadd--oonnllyy))
  1728.               If non-zero, then the --oo option was supplied on the
  1729.               command line, or a date different from today's true
  1730.               date  was  supplied.  If non-zero, then OONNCCEE direc-
  1731.               tives will be ignored.
  1732.  
  1733.        $$IInnffDDeellttaa ((rreeaadd--oonnllyy))
  1734.               If non-zero, then the --tt option was supplied on the
  1735.               command line.
  1736.  
  1737.        $$LLaattDDeegg,, $$LLaattMMiinn,, $$LLaattSSeecc
  1738.               These specify the latitude of your location.  $$LLaatt--
  1739.               DDeegg can range from -90 to 90, and the  others  from
  1740.               -59 to 59.  Northern latitudes are positive; south-
  1741.               ern ones are negative.  For southern latitudes, all
  1742.               three components should be negative.
  1743.  
  1744.        $$LLooccaattiioonn ((SSTTRRIINNGG ttyyppee))
  1745.               This  is a string specifying the name of your loca-
  1746.               tion.  It is usually the name of your town or city.
  1747.               It  can be set to whatever you like, but good style
  1748.               indicates that it should be  kept  consistent  with
  1749.               the latitude and longitude system variables.
  1750.  
  1751.        $$LLoonnggDDeegg,, $$LLoonnggMMiinn,, $$LLoonnggSSeecc
  1752.               These  specify  the  longitude  of  your  location.
  1753.               $$LLoonnggDDeegg can range from -180 to 180.  Western  lon-
  1754.               gitudes are positive; eastern ones are negative.
  1755.  
  1756.               The  latitude and longitude information is required
  1757.               for the functions ssuunnrriissee(()) and ssuunnsseett(()).   Default
  1758.               values  can be compiled into RReemmiinndd, or you can SSEETT
  1759.               the correct values at the start  of  your  reminder
  1760.               scripts.
  1761.  
  1762.        $$MMaaxxSSaattIItteerr
  1763.               The  maximum  number  of iterations for the SSAATTIISSFFYY
  1764.               clause (described later.)  Must be at least 10.
  1765.  
  1766.        $$MMiinnssFFrroommUUTTCC
  1767.               The number of minutes between Universal Time  Coor-
  1768.               dinated  and  local time.  If $$CCaallccUUTTCC is non-zero,
  1769.               this is calculated upon startup of RReemmiinndd.   Other-
  1770.               wise,  you  must set it explicitly.  If $$CCaallccUUTTCC is
  1771.               zero, then $$MMiinnssFFrroommUUTTCC is used in the astronomical
  1772.               calculations.  You must adjust it for daylight sav-
  1773.               ings time yourself.  Also, if you want to  initial-
  1774.               ize  $$MMiinnssFFrroommUUTTCC using the --ii command-line option,
  1775.               you must also set $$CCaallccUUTTCC to 0 with the --ii option.
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                          13 October 1993                       27
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. REMIND(1)                                               REMIND(1)
  1787.  
  1788.  
  1789.        $$NNeexxttMMooddee ((rreeaadd--oonnllyy))
  1790.               If non-zero, then the --nn option was supplied on the
  1791.               command line.
  1792.  
  1793.        $$NNuummQQuueeuueedd ((rreeaadd--oonnllyy))
  1794.               Contains the number of reminders queued so far  for
  1795.               background  timed  triggering.   For MS-DOS, always
  1796.               returns 0.
  1797.  
  1798.        $$NNuummTTrriigg ((rreeaadd--oonnllyy))
  1799.               Contains the number of reminders triggered for  the
  1800.               current date.  One use for this variable is as fol-
  1801.               lows:  Suppose you wish to shade in the  box  of  a
  1802.               PostScript  calendar  whenever  a  holiday is trig-
  1803.               gered.  You could save the value of $$NNuummTTrriigg  in  a
  1804.               regular variable prior to executing a block of hol-
  1805.               iday reminders.  If the value of $$NNuummTTrriigg after the
  1806.               holiday block is greater than the saved value, then
  1807.               at least one holiday was  triggered,  and  you  can
  1808.               execute  the  command to shade in the calendar box.
  1809.               (See the section "Calendar Mode".)
  1810.  
  1811.               Note that $$NNuummTTrriigg is affected  _o_n_l_y  by  RREEMM  com-
  1812.               mands;  triggers  in  IIFFTTRRIIGG commands do not affect
  1813.               it.
  1814.  
  1815.        $$PPSSCCaall ((rreeaadd--oonnllyy))
  1816.               If non-zero, then the --pp option was supplied on the
  1817.               command line.
  1818.  
  1819.        $$RRuunnOOffff ((rreeaadd--oonnllyy))
  1820.               If non-zero, the RRUUNN directives are disabled.
  1821.  
  1822.        $$SSiimmpplleeCCaall ((rreeaadd--oonnllyy))
  1823.               Set  to  a non-zero value if _e_i_t_h_e_r of the --pp or --ss
  1824.               command-line options was supplied.
  1825.  
  1826.        $$SSoorrttBByyDDaattee ((rreeaadd--oonnllyy))
  1827.               Set to 0 if no --gg option is used, 1 if  sorting  by
  1828.               date in ascending order, or 2 if sorting by date in
  1829.               descending order.
  1830.  
  1831.        $$SSoorrttBByyPPrriioo ((rreeaadd--oonnllyy))
  1832.               Set to 0 if no --gg option is used, 1 if  sorting  by
  1833.               priority  in  ascending  order,  or 2 if sorting by
  1834.               priority in descending order.
  1835.  
  1836.        $$SSoorrttBByyTTiimmee ((rreeaadd--oonnllyy))
  1837.               Set to 0 if no --gg option is used, 1 if  sorting  by
  1838.               time in ascending order, or 2 if sorting by time in
  1839.               descending order.
  1840.  
  1841.        $$SSuubbssIInnddeenntt
  1842.               The number of spaces by which all lines (except the
  1843.  
  1844.  
  1845.  
  1846.                          13 October 1993                       28
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852. REMIND(1)                                               REMIND(1)
  1853.  
  1854.  
  1855.               first)  of an MMSSFF-type reminder should be indented.
  1856.               The default is 0.
  1857.  
  1858.        Note:  If any of the calendar modes are  in  effect,  then
  1859.        the  values  of  $Daemon,  $DontFork,  $DontTrigAts, $Don-
  1860.        tQueue, $HushMode, $IgnoreOnce, $InfDelta,  and  $NextMode
  1861.        are not meaningful.
  1862.  
  1863.        BBUUIILLTT--IINN FFUUNNCCTTIIOONNSS
  1864.  
  1865.        RReemmiinndd  has  a plethora of built-in functions.  The syntax
  1866.        for a function call is the same as in  C  -  the  function
  1867.        name,  followed  a  comma-separated  list  of arguments in
  1868.        parentheses.  Function names are not case-sensitive.  If a
  1869.        function  takes  no arguments, it must be followed by "()"
  1870.        in the function call.  Otherwise, RReemmiinndd will interpret it
  1871.        as a variable name, and probably not work correctly.
  1872.  
  1873.        In  the descriptions below, short forms are used to denote
  1874.        acceptable types for the arguments.  The  characters  "i",
  1875.        "s",  "d"  and "t" denote IINNTT, SSTTRRIINNGG, DDAATTEE and TTIIMMEE argu-
  1876.        ments, respectively.  If an argument can be one of several
  1877.        types,  the  characters  are  concatenated.   For example,
  1878.        "di_arg" denotes an argument which can be  a  DDAATTEE  or  an
  1879.        IINNTT.   "x_arg"  denotes  an  argument  which can be of any
  1880.        type.  The type of the argument is followed by  an  under-
  1881.        score  and  an  identifier naming the argument, for conve-
  1882.        nience.
  1883.  
  1884.        The built-in functions are:
  1885.  
  1886.        aabbss((ii__nnuumm))
  1887.               Returns the absolute value of _n_u_m.
  1888.  
  1889.        aacccceessss((ss__ffiillee,, ssii__mmooddee))
  1890.               Tests the access permissions  for  the  file  _f_i_l_e.
  1891.               _M_o_d_e can be a string, containing a mix of the char-
  1892.               acters "rwx" for read, write and execute permission
  1893.               testing.   Alternatively,  _m_o_d_e  can be a number as
  1894.               described in the UNIX aacccceessss(2) system  call.   The
  1895.               function returns 0 if the file can be accessed with
  1896.               the specified _m_o_d_e, and -1 otherwise.
  1897.  
  1898.        aarrggss((ss__ffnnaammee))
  1899.               Returns the number of  arguments  expected  by  the
  1900.               user-defined function _f_n_a_m_e, or -1 if no such user-
  1901.               defined function exists.  Note that  this  function
  1902.               examines  only user-defined functions, not built-in
  1903.               functions.  Its main use is to determine whether or
  1904.               not  a  particular  user-defined  function has been
  1905.               defined previously.  The aarrggss(()) function is  avail-
  1906.               able  only  in versions of RReemmiinndd from 03.00.04 and
  1907.               up.
  1908.  
  1909.  
  1910.  
  1911.  
  1912.                          13 October 1993                       29
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918. REMIND(1)                                               REMIND(1)
  1919.  
  1920.  
  1921.        aasscc((ss__ssttrriinngg))
  1922.               Returns an IINNTT which is the ASCII code of the first
  1923.               character  in  _s_t_r_i_n_g.   As a special case, aasscc((""""))
  1924.               returns 0.
  1925.  
  1926.        bbaasseeyyrr(())
  1927.               Returns the "base year"  which  was  compiled  into
  1928.               RReemmiinndd  (normally  1990.)   All  dates  are  stored
  1929.               internally as the number of days since 1 January of
  1930.               bbaasseeyyrr(()).
  1931.  
  1932.        cchhaarr((ii__ii11 [[,,ii__ii22......]]))
  1933.               This function can take any number of IINNTT arguments.
  1934.               It returns a SSTTRRIINNGG consisting  of  the  characters
  1935.               specified  by the arguments.  Note that none of the
  1936.               arguments can be 0, unless there is only one  argu-
  1937.               ment.  As a special case, cchhaarr((00)) returns "".
  1938.  
  1939.               Note  that because RReemmiinndd does not support escaping
  1940.               of characters in strings, the only  way  to  get  a
  1941.               double-quote  in a string is to use cchhaarr((3344)).  Yes,
  1942.               I know it's not portable - it assumes ASCII coding.
  1943.  
  1944.        cchhoooossee((ii__iinnddeexx,, xx__aarrgg11 [[,,xx__aarrgg22......]]))
  1945.               CChhoooossee  must take at least two arguments, the first
  1946.               of which is an IINNTT.  If _i_n_d_e_x is _n,  then  the  _nth
  1947.               subsequent  argument is returned.  If _i_n_d_e_x is less
  1948.               than 1, then _a_r_g_1 is returned.  If _i_n_d_e_x is greater
  1949.               than  the  number of subsequent arguments, then the
  1950.               last argument is returned.  Examples:
  1951.  
  1952.                  cchhoooossee((00,, ""ffoooo"",, 11::1133,, 11000000)) returns "foo"
  1953.                  cchhoooossee((11,, ""ffoooo"",, 11::1133,, 11000000)) returns "foo"
  1954.                  cchhoooossee((22,, ""ffoooo"",, 11::1133,, 11000000)) returns 1:13
  1955.                  cchhoooossee((33,, ""ffoooo"",, 11::1133,, 11000000)) returns 1000
  1956.                  cchhoooossee((44,, ""ffoooo"",, 11::1133,, 11000000)) returns 1000
  1957.               Note that all  arguments  to  cchhoooossee(())  are  _a_l_w_a_y_s
  1958.               evaluated.
  1959.  
  1960.        ccooeerrccee((ss__ttyyppee,, xx__aarrgg))
  1961.               This  function  converts _a_r_g to the specified _t_y_p_e,
  1962.               if such conversion is possible.  _T_y_p_e must  be  one
  1963.               of   "INT",   "STRING",  "DATE"  or  "TIME"  (case-
  1964.               insensitive).  The conversion rules are as follows:
  1965.  
  1966.               If  _a_r_g  is  already  of  the _t_y_p_e specified, it is
  1967.               returned unchanged.
  1968.  
  1969.               If _t_y_p_e is "STRING", then _a_r_g  is  converted  to  a
  1970.               string consisting of its printed representation.
  1971.  
  1972.               If  _t_y_p_e is "DATE", then an IINNTT _a_r_g is converted by
  1973.               interpreting it as the number of days since 1  Jan-
  1974.               uary  bbaasseeyyrr(()).   A  SSTTRRIINNGG  _a_r_g  is  converted  by
  1975.  
  1976.  
  1977.  
  1978.                          13 October 1993                       30
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984. REMIND(1)                                               REMIND(1)
  1985.  
  1986.  
  1987.               attempting to read it as if it were a printed date.
  1988.               A TTIIMMEE _a_r_g cannot be converted to a date.
  1989.  
  1990.               If  _t_y_p_e is "TIME", then an IINNTT _a_r_g is converted by
  1991.               interpreting it as the number of minutes since mid-
  1992.               night.   A SSTTRRIINNGG _a_r_g is converted by attempting to
  1993.               read it as if it were a printed time.  A  DDAATTEE  _a_r_g
  1994.               cannot be converted to a time.
  1995.  
  1996.               If  _t_y_p_e is "INT", then DDAATTEE and TTIIMMEE arguments are
  1997.               converted using the reverse of procedures described
  1998.               above.   A SSTTRRIINNGG _a_r_g is converted by parsing it as
  1999.               an integer.
  2000.  
  2001.        ddaattee((ii__yy,, ii__mm,, ii__dd))
  2002.               The ddaattee(()) function returns a DDAATTEE object with  the
  2003.               year,  month  and  day components specified by _y, _m
  2004.               and _d.
  2005.  
  2006.        ddaayy((dd__ddaattee))
  2007.               This function takes a  DDAATTEE  as  an  argument,  and
  2008.               returns  an IINNTT which is the day-of-month component
  2009.               of _d_a_t_e.
  2010.  
  2011.        ddaayyssiinnmmoonn((ii__mm,, ii__yy))
  2012.               Returns the number of days in month _m (1-12) of the
  2013.               year _y.
  2014.  
  2015.        ddeeffiinneedd((ss__vvaarr))
  2016.               Returns  1 if the variable named by _v_a_r is defined,
  2017.               or 0 if it is not.
  2018.               Note that ddeeffiinneedd(()) takes a SSTTRRIINNGG argument;  thus,
  2019.               to check if variable X is defined, use:
  2020.  
  2021.                         defined("X")
  2022.  
  2023.               and not:
  2024.  
  2025.                         defined(X)
  2026.  
  2027.               The  second example will attempt to evaluate X, and
  2028.               will return an error if it is undefined or  not  of
  2029.               type SSTTRRIINNGG.
  2030.  
  2031.        ddoossuubbsstt((ss__ssttrr [[,,dd__ddaattee [[,,tt__ttiimmee]]]]))
  2032.               Returns a SSTTRRIINNGG which is the result of passing _s_t_r
  2033.               through the substitution filter described  earlier.
  2034.               The  parameters  _d_a_t_e and _t_i_m_e establish the effec-
  2035.               tive trigger date and time used by the substitution
  2036.               filter.  If _d_a_t_e and _t_i_m_e are omitted, they default
  2037.               to ttooddaayy(()) and nnooww(()).
  2038.  
  2039.               Note that if _s_t_r does not end with "%",  a  newline
  2040.               character  will  be added to the end of the result.
  2041.  
  2042.  
  2043.  
  2044.                          13 October 1993                       31
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050. REMIND(1)                                               REMIND(1)
  2051.  
  2052.  
  2053.               Also, calling ddoossuubbsstt(()) with a _d_a_t_e which is in the
  2054.               past  (i.e.,  if _d_a_t_e < ttooddaayy(())) will produce unde-
  2055.               fined results.
  2056.  
  2057.               DDoossuubbsstt(()) is only available starting  from  version
  2058.               03.00.04 of RReemmiinndd.
  2059.  
  2060.        eeaasstteerrddaattee((ddii__aarrgg))
  2061.               If  _a_r_g  is an IINNTT, then returns the date of Easter
  2062.               Sunday for the specified year.  If _a_r_g is  a  DDAATTEE,
  2063.               then  returns the date of the next Easter Sunday on
  2064.               or after _a_r_g.
  2065.  
  2066.        ffiilleeddaattee((ss__ffiilleennaammee))
  2067.               Returns the  modification  date  of  _f_i_l_e_n_a_m_e.   If
  2068.               _f_i_l_e_n_a_m_e  does  not exist, or its modification date
  2069.               is before the year  bbaasseeyyrr(()),  then  1  January  of
  2070.               bbaasseeyyrr(()) is returned.
  2071.  
  2072.        ffiilleeddiirr(())
  2073.               Returns  the  directory  which contains the current
  2074.               file being processed.  It  may  be  a  relative  or
  2075.               absolute  pathname, but is guaranteed to be correct
  2076.               for use in an IINNCCLLUUDDEE command as follows:
  2077.  
  2078.                  INCLUDE [filedir()]/stuff
  2079.  
  2080.               This includes the file "stuff" in the  same  direc-
  2081.               tory as the current file being processed.
  2082.  
  2083.        ffiilleennaammee(())
  2084.               Returns  (as a SSTTRRIINNGG) the name of the current file
  2085.               being processed by RReemmiinndd.  Inside included  files,
  2086.               returns the name of the included file.
  2087.  
  2088.        ggeetteennvv((ss__eennvvvvaarr))
  2089.               Similar  to  the  ggeetteennvv(2) system call.  Returns a
  2090.               string representing  the  value  of  the  specified
  2091.               environment  variable.   Returns "" if the environ-
  2092.               ment variable is not defined.  Note that the  names
  2093.               of   environment   variables  are  generally  case-
  2094.               sensitive; thus, getenv("HOME") is not the same  as
  2095.               getenv("home").
  2096.  
  2097.        hhoouurr((tt__ttiimmee))
  2098.               Returns the hour component of _t_i_m_e.
  2099.  
  2100.        iiiiff((ssii__tteesstt11,, xx__aarrgg11,, [[ssii__tteesstt22,, xx__aarrgg22,,......]],, xx__ddeeffaauulltt))
  2101.               If  _t_e_s_t_1  is  not zero or the null string, returns
  2102.               _a_r_g_1.  Otherwise, if _t_e_s_t_2 is not zero or the  null
  2103.               string,  returns  _a_r_g_2,  and  so on.  If all of the
  2104.               _t_e_s_t arguments are false,  returns  _d_e_f_a_u_l_t.   Note
  2105.               that  all  arguments  are  _a_l_w_a_y_s  evaluated.  This
  2106.               function accepts an odd number of arguments -  note
  2107.  
  2108.  
  2109.  
  2110.                          13 October 1993                       32
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116. REMIND(1)                                               REMIND(1)
  2117.  
  2118.  
  2119.               that  prior  to  version  03.00.05  of  RReemmiinndd,  it
  2120.               accepted 3 arguments only.  The 3-argument  version
  2121.               of  iiiiff(())  is  compatible with previous versions of
  2122.               RReemmiinndd.
  2123.  
  2124.        iinnddeexx((ss__sseeaarrcchh,, ss__ttaarrggeett [[,,ii__ssttaarrtt))
  2125.               Returns an IINNTT which is the location of  _t_a_r_g_e_t  in
  2126.               the string _s_e_a_r_c_h.  The first character of a string
  2127.               is numbered 1.  If _t_a_r_g_e_t does not exist in _s_e_a_r_c_h,
  2128.               then 0 is returned.
  2129.  
  2130.               The optional parameter _s_t_a_r_t specifies the position
  2131.               in _s_e_a_r_c_h at which to start looking for _t_a_r_g_e_t.
  2132.  
  2133.        iissddsstt(([[dd__ddaattee [[,,tt__ttiimmee]]]]))
  2134.               Returns a positive number if daylight savings  time
  2135.               is  in effect on the specified date and time.  _D_a_t_e
  2136.               defaults to ttooddaayy(()) and _t_i_m_e defaults to  midnight.
  2137.  
  2138.               Note  that this function is only as reliable as the
  2139.               C run-time  library  functions.   It  is  available
  2140.               starting with version 03.00.07 of RReemmiinndd.
  2141.  
  2142.        iisslleeaapp((iidd__aarrgg))
  2143.               Returns  1  if _a_r_g is a leap year, and 0 otherwise.
  2144.               _A_r_g can be either an IINNTT or a DDAATTEE  object.   If  a
  2145.               DDAATTEE  is  supplied, then the year component is used
  2146.               in the test.
  2147.  
  2148.        iissoommiitttteedd((dd__ddaattee))
  2149.               Returns 1 if _d_a_t_e is  omitted,  given  the  current
  2150.               global OOMMIITT context.  Returns 0 otherwise.
  2151.  
  2152.        hheebbddaattee((ii__ddaayy,, ss__hheebbmmoonn [[,,iidd__yyrrssttaarrtt [[,,ii__jjaahhrr
  2153.               [[,,ii__aaffllaagg]]]]]]))
  2154.               Support for Hebrew dates -  see  the  section  "The
  2155.               Hebrew Calendar"
  2156.  
  2157.        hheebbddaayy((dd__ddaattee))
  2158.               Support  for  Hebrew  dates  - see the section "The
  2159.               Hebrew Calendar"
  2160.  
  2161.        hheebbmmoonn((dd__ddaattee))
  2162.               Support for Hebrew dates -  see  the  section  "The
  2163.               Hebrew Calendar"
  2164.  
  2165.        hheebbyyeeaarr((dd__ddaattee))
  2166.               Support  for  Hebrew  dates  - see the section "The
  2167.               Hebrew Calendar"
  2168.  
  2169.        llaanngguuaaggee(())
  2170.               Returns a SSTTRRIINNGG naming the language  supported  by
  2171.               RReemmiinndd.    (See  "Foreign  Language  Support.")  By
  2172.               default, RReemmiinndd  is  compiled  to  support  English
  2173.  
  2174.  
  2175.  
  2176.                          13 October 1993                       33
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182. REMIND(1)                                               REMIND(1)
  2183.  
  2184.  
  2185.               messages,  so this function returns "English".  For
  2186.               other languages,  this  function  will  return  the
  2187.               English  name  of the language (e.g. "German") Note
  2188.               that llaanngguuaaggee(()) is not  available  in  versions  of
  2189.               RReemmiinndd prior to 03.00.02.
  2190.  
  2191.        lloowweerr((ss__ssttrriinngg))
  2192.               Returns  a SSTTRRIINNGG with all upper-case characters in
  2193.               _s_t_r_i_n_g converted to lower-case.
  2194.  
  2195.        mmaaxx((xx__aarrgg11 [[,,xx__aarrgg22......))
  2196.               Can take any number of arguments, and  returns  the
  2197.               maximum.   The  arguments  can  be of any type, but
  2198.               must all be of the same type.  They are compared as
  2199.               with the > operator.
  2200.  
  2201.        mmiinn((xx__aarrgg11 [[,,xx__aarrgg22......))
  2202.               Can  take  any number of arguments, and returns the
  2203.               minimum.  The arguments can be  of  any  type,  but
  2204.               must all be of the same type.  They are compared as
  2205.               with the < operator.
  2206.  
  2207.        mmiinnssffrroommuuttcc(([[dd__ddaattee [[,,tt__ttiimmee]]]]))
  2208.               Returns the number of minutes from  Universal  Time
  2209.               Coordinated  (formerly  GMT)  to  local time on the
  2210.               specified date and time.  _D_a_t_e defaults to  ttooddaayy(())
  2211.               and  _t_i_m_e  defaults  to midnight.  If local time is
  2212.               before UTC, the result is negative.  Otherwise, the
  2213.               result is positive.
  2214.  
  2215.               Note  that this function is only as reliable as the
  2216.               C run-time  library  functions.   It  is  available
  2217.               starting with version 03.00.07 of RReemmiinndd.
  2218.  
  2219.        mmiinnuuttee((tt__ttiimmee))
  2220.               Returns the minute component of _t_i_m_e.
  2221.  
  2222.        mmoonn((ddii__aarrgg))
  2223.               If  _a_r_g  is  of  DDAATTEE  type, returns a string which
  2224.               names the month component of the date.  If  _a_r_g  is
  2225.               an  IINNTT  from 1 to 12, returns a string which names
  2226.               the month.
  2227.  
  2228.        mmoonnnnuumm((dd__ddaattee))
  2229.               Returns an IINNTT from 1 to 12, representing the month
  2230.               component of _d_a_t_e.
  2231.  
  2232.        mmoooonnddaattee((ii__pphhaassee [[,,dd__ddaattee [[,,tt__ttiimmee]]]]))
  2233.               This  function returns the date of the first occur-
  2234.               rence of the phase _p_h_a_s_e of the moon  on  or  after
  2235.               _d_a_t_e and _t_i_m_e.  _P_h_a_s_e can range from 0 to 3, with 0
  2236.               signifying new moon, 1 first quarter, 2 full  moon,
  2237.               and  3  third  quarter.   If  _d_a_t_e  is  omitted, it
  2238.               defaults  to  ttooddaayy(()).   If  _t_i_m_e  is  omitted,  it
  2239.  
  2240.  
  2241.  
  2242.                          13 October 1993                       34
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248. REMIND(1)                                               REMIND(1)
  2249.  
  2250.  
  2251.               defaults to midnight.
  2252.  
  2253.               For  example, the following returns the date of the
  2254.               next full moon:
  2255.  
  2256.                         SET fullmoon moondate(2)
  2257.  
  2258.  
  2259.        mmoooonnttiimmee((ii__pphhaassee [[,,dd__ddaattee [[,,tt__ttiimmee]]]]))
  2260.               This function returns the time of the first  occur-
  2261.               rence  of  the  phase _p_h_a_s_e of the moon on or after
  2262.               _d_a_t_e and _t_i_m_e.  _P_h_a_s_e can range from 0 to 3, with 0
  2263.               signifying  new moon, 1 first quarter, 2 full moon,
  2264.               and 3  third  quarter.   If  _d_a_t_e  is  omitted,  it
  2265.               defaults  to  ttooddaayy(()).   If  _t_i_m_e  is  omitted,  it
  2266.               defaults to midnight.  MMoooonnttiimmee(()) is intended to be
  2267.               used  in  conjunction  with  mmoooonnddaattee(()).  The mmoooonn--
  2268.               ddaattee(()) and mmoooonnttiimmee(())  functions  are  accurate  to
  2269.               within  a  couple  of  minutes of the times in "Old
  2270.               Farmer's Almanac" for Ottawa, Ontario.
  2271.  
  2272.               For example, the following  returns  the  date  and
  2273.               time of the next full moon:
  2274.  
  2275.                         MSG Next full moon at [moontime(2)] on [moondate(2)]
  2276.  
  2277.  
  2278.        mmoooonnpphhaassee(([[dd__ddaattee [[,,tt__ttiimmee]]]]))
  2279.               This function returns the phase of the moon on _d_a_t_e
  2280.               and _t_i_m_e, which default to  ttooddaayy(())  and  midnight,
  2281.               respectively.   The  returned  value  is an integer
  2282.               from 0 to 359, representing the phase of  the  moon
  2283.               in  degrees.   0 is a new moon, 180 is a full moon,
  2284.               90 is first-quarter, etc.
  2285.  
  2286.        nnooww(())  Returns the current system time, as a TTIIMMEE type.
  2287.  
  2288.        oorrdd((ii__nnuumm))
  2289.               Returns a string which is the ordinal  number  _n_u_m.
  2290.               For  example,  oorrdd((22))  returns  "2nd", and oorrdd((221133))
  2291.               returns "213th".
  2292.  
  2293.        oossttyyppee(())
  2294.               Returns "UNIX" on UNIX systems, "MSDOS"  on  MS-DOS
  2295.               systems,  and  "OS/2"  on OS/2 systems.  If you run
  2296.               RReemmiinndd in an MS-DOS box under OS/2,  this  function
  2297.               returns "MSDOS".
  2298.  
  2299.        pplluurraall((ii__nnuumm [[,,ss__ssttrr11 [[,,ss__ssttrr22]]]]))
  2300.               Can take from one to three arguments.  If one argu-
  2301.               ment is supplied, returns "s" if _n_u_m is not 1,  and
  2302.               "" if _n_u_m is 1.
  2303.  
  2304.               If  two  arguments are supplied, returns _s_t_r_1 + "s"
  2305.  
  2306.  
  2307.  
  2308.                          13 October 1993                       35
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. REMIND(1)                                               REMIND(1)
  2315.  
  2316.  
  2317.               if _n_u_m is not 1.  Otherwise, returns _s_t_r_1.
  2318.  
  2319.               If three arguments are supplied,  returns  _s_t_r_1  if
  2320.               _n_u_m is 1, and _s_t_r_2 otherwise.
  2321.  
  2322.        ppssmmoooonn((ii__pphhaassee [[,,ii__ssiizzee]]))
  2323.               Returns  a  SSTTRRIINNGG consisting of PostScript code to
  2324.               draw a moon in the upper-left hand  corner  of  the
  2325.               calendar  box.   _P_h_a_s_e  specifies  the phase of the
  2326.               moon, and is 0 (new moon),  1  (first  quarter),  2
  2327.               (full moon) or 3 (third quarter).  If _s_i_z_e is spec-
  2328.               ified, it  controls  the  radius  of  the  moon  in
  2329.               PostScript  units (1/72 inch.)  If it is not speci-
  2330.               fied, the size of the day-number font is used.
  2331.  
  2332.               For example, the following four  lines  place  moon
  2333.               symbols on the PostScript calendar:
  2334.  
  2335.                         REM [trigger(moondate(0))] PS [psmoon(0)]
  2336.                         REM [trigger(moondate(1))] PS [psmoon(1)]
  2337.                         REM [trigger(moondate(2))] PS [psmoon(2)]
  2338.                         REM [trigger(moondate(3))] PS [psmoon(3)]
  2339.  
  2340.  
  2341.        ppsssshhaaddee((ii__nnuumm))
  2342.               Returns  a SSTTRRIINNGG which consists of PostScript com-
  2343.               mands to shade a calendar box.  _N_u_m can range  from
  2344.               0  (completely  black)  to  100 (completely white.)
  2345.               Here's an example of how to use this:
  2346.  
  2347.                         REM Sat Sun PS [psshade(95)]
  2348.  
  2349.               The above command emits PostScript code to  lightly
  2350.               shade  the  boxes  for  Saturday  and  Sunday  in a
  2351.               PostScript calendar.
  2352.  
  2353.        rreeaallttooddaayy(())
  2354.               Returns the date as provided by the operating  sys-
  2355.               tem.   This  is  in contrast to RReemmiinndd's concept of
  2356.               "today", which may be changed if it is  running  in
  2357.               calendar  mode,  or  if a date has been supplied on
  2358.               the command line.
  2359.  
  2360.        ssggnn((ii__nnuumm))
  2361.               Returns -1 if _n_u_m is negative, 1 if  _n_u_m  is  posi-
  2362.               tive, and 0 if _n_u_m is zero.
  2363.  
  2364.        sshheellll((ss__ccmmdd))
  2365.               Executes  _c_m_d  as a system command, and returns the
  2366.               first 511 characters of output resulting from  _c_m_d.
  2367.               Any whitespace character in the output is converted
  2368.               to a space.  Note that if RRUUNN  OOFFFF  has  been  exe-
  2369.               cuted, or the --rr command-line option has been used,
  2370.               sshheellll(()) will result in an error, and _c_m_d  will  not
  2371.  
  2372.  
  2373.  
  2374.                          13 October 1993                       36
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380. REMIND(1)                                               REMIND(1)
  2381.  
  2382.  
  2383.               be executed.
  2384.  
  2385.        ssttrrlleenn((ss__ssttrr))
  2386.               Returns the length of _s_t_r.
  2387.  
  2388.        ssuubbssttrr((ss__ssttrr,, ii__ssttaarrtt [[,,ii__eenndd]]))
  2389.               Returns  a  SSTTRRIINNGG  consisting of all characters in
  2390.               _s_t_r from _s_t_a_r_t up to and including _e_n_d.  Characters
  2391.               are  numbered from 1.  If _e_n_d is not supplied, then
  2392.               it defaults to the length of _s_t_r.
  2393.  
  2394.        ssuunnrriissee(([[dd__ddaattee]]))
  2395.               Returns a TTIIMMEE indicating the time  of  sunrise  on
  2396.               the specified _d_a_t_e (default ttooddaayy(()).)  In high lat-
  2397.               titudes, there may be no sunrise  on  a  particular
  2398.               day, in which case ssuunnrriissee(()) returns the IINNTT 0.
  2399.  
  2400.        ssuunnsseett(([[dd__ddaattee]]))
  2401.               Returns a TTIIMMEE indicating the time of sunset on the
  2402.               specified _d_a_t_e (default ttooddaayy(()).)  In  high  latti-
  2403.               tudes,  there may be no sunset on a particular day,
  2404.               in which case ssuunnsseett(()) returns the IINNTT 0.
  2405.  
  2406.               The functions ssuunnrriissee(()) and ssuunnsseett(()) are  based  on
  2407.               an algorithm in "Almanac for Computers for the year
  2408.               1978" by L. E. Doggett,  Nautical  Almanac  Office,
  2409.               USNO.   They  require the latitude and longitude to
  2410.               be specified  by  setting  the  appropriate  system
  2411.               variables.   (See  "System  Variables".)   The  sun
  2412.               functions should be accurate to within about 2 min-
  2413.               utes  for  latitudes  lower  than  60 degrees.  The
  2414.               functions  are  available  starting  from   version
  2415.               03.00.07 of RReemmiinndd.
  2416.  
  2417.        ttiimmee((ii__hhrr,, ii__mmiinn))
  2418.               Creates  a TTIIMMEE with the hour and minute components
  2419.               specified by _h_r and _m_i_n.
  2420.  
  2421.        ttooddaayy(())
  2422.               Returns RReemmiinndd's notion of "today."   This  may  be
  2423.               the  actual  system date, or a date supplied on the
  2424.               command line, or the date  of  the  calendar  entry
  2425.               currently being computed.
  2426.  
  2427.        ttrriiggddaattee(())
  2428.               Returns the calculated trigger date of the last RREEMM
  2429.               or IIFFTTRRIIGG command.  If used in the _b_o_d_y  of  a  RREEMM
  2430.               command, returns that command's trigger date.
  2431.  
  2432.        ttrriiggggeerr((dd__ddaattee [[,,tt__ttiimmee [[,,ii__uuttccffllaagg]]]]))
  2433.               Returns a string suitable for use in a RREEMM command,
  2434.               allowing you to calculate trigger dates in advance.
  2435.               (See  the  section  "Expression  pasting"  for more
  2436.               information.)  Normally, the _d_a_t_e and _t_i_m_e are  the
  2437.  
  2438.  
  2439.  
  2440.                          13 October 1993                       37
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446. REMIND(1)                                               REMIND(1)
  2447.  
  2448.  
  2449.               local  date  and  time; however, if _u_t_c_f_l_a_g is non-
  2450.               zero, the _d_a_t_e and  _t_i_m_e  are  interpreted  as  UTC
  2451.               times, and are converted to local time.  Examples:
  2452.  
  2453.               trigger('1993/04/01')
  2454.  
  2455.               returns "1 April 1993",
  2456.  
  2457.               trigger('1994/08/09', 12:33)
  2458.  
  2459.               returns "9 August 1994 AT 12:33", and
  2460.  
  2461.               trigger('1994/12/01', 03:00, 1)
  2462.  
  2463.               returns  "30 November 1994 AT 22:00" for EST, which
  2464.               is 5 hours behind UTC.  The  value  for  your  time
  2465.               zone may differ.
  2466.  
  2467.        ttrriiggttiimmee(())
  2468.               Returns the time of the last RREEMM command with an AATT
  2469.               clause.
  2470.  
  2471.        ttrriiggvvaalliidd(())
  2472.               Returns 1 if the value returned  by  ttrriiggddaattee(())  is
  2473.               valid  for the most recent RREEMM command, or 0 other-
  2474.               wise.  Sometimes RREEMM commands  cannot  calculate  a
  2475.               trigger  date.  For example, the following RREEMM com-
  2476.               mand can never be triggered:
  2477.  
  2478.                  REM Mon OMIT Mon SKIP MSG Impossible!
  2479.  
  2480.  
  2481.        ttyyppeeooff((xx__aarrgg))
  2482.               Returns "STRING", "INT", "DATE" or "TIME",  depend-
  2483.               ing on the type of _a_r_g.
  2484.  
  2485.        uuppppeerr((ss__ssttrriinngg))
  2486.               Returns  a SSTTRRIINNGG with all lower-case characters in
  2487.               _s_t_r_i_n_g converted to upper-case.
  2488.  
  2489.        vvaalluuee((ss__vvaarrnnaammee [[,,xx__ddeeffaauulltt]]))
  2490.               Returns the value of the specified  variable.   For
  2491.               example,  value("X"+"Y") returns the value of vari-
  2492.               able XY, if it is defined.  If XY is  not  defined,
  2493.               an error results.
  2494.  
  2495.               However,  if  you  supply  a second argument, it is
  2496.               returned  if  the  _v_a_r_n_a_m_e  is  not  defined.   The
  2497.               expression  value("XY",  0)  will return 0 if XY is
  2498.               not defined, and the value of XY if it is  defined.
  2499.  
  2500.        vveerrssiioonn(())
  2501.               Returns  a string specifying the version of RReemmiinndd.
  2502.               For version 03.00.04, returns  "03.00.04".   It  is
  2503.  
  2504.  
  2505.  
  2506.                          13 October 1993                       38
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512. REMIND(1)                                               REMIND(1)
  2513.  
  2514.  
  2515.               guaranteed  that  as  new  versions  of  RReemmiinndd are
  2516.               released, the  value  returned  by  vveerrssiioonn(())  will
  2517.               strictly  increase,  according  to  the  rules  for
  2518.               string ordering.
  2519.  
  2520.        wwkkddaayy((ddii__aarrgg))
  2521.               If _a_r_g is a DDAATTEE, returns a string representing the
  2522.               day of the week of the date.  If _a_r_g is an IINNTT from
  2523.               0 to 6, returns the corresponding weekday ("Sunday"
  2524.               to "Saturday").
  2525.  
  2526.        wwkkddaayynnuumm((dd__ddaattee))
  2527.               Returns  a number from 0 to 6 representing the day-
  2528.               of-week of the specified _d_a_t_e.  (0 represents  Sun-
  2529.               day, and 6 represents Saturday.)
  2530.  
  2531.        yyeeaarr((dd__ddaattee))
  2532.               Returns  a IINNTT which is the year component of _d_a_t_e.
  2533.  
  2534. EEXXPPRREESSSSIIOONN PPAASSTTIINNGG
  2535.        An extremely powerful feature of RReemmiinndd is its macro capa-
  2536.        bility, or "expression pasting."
  2537.  
  2538.        In  almost  any situation where RReemmiinndd is not expecting an
  2539.        expression, you can "paste" an expression in.  To do this,
  2540.        surround  the  expression with square brackets.  For exam-
  2541.        ple:
  2542.  
  2543.             REM [trigger(mydate)] MSG foo
  2544.  
  2545.        This evaluates  the  expression  "trigger(mydate)",  where
  2546.        "mydate"  is  presumably  some  pre-computed variable, and
  2547.        then "pastes" the result into  the  command-line  for  the
  2548.        parser to process.
  2549.  
  2550.        A formal description of this is:  When RReemmiinndd encounters a
  2551.        "pasted-in" expression, it evaluates the  expression,  and
  2552.        coerces  the  result to a SSTTRRIINNGG.  It then substitutes the
  2553.        string for the pasted-in expression, and  continues  pars-
  2554.        ing.   Note,  however, that expressions are evaluated only
  2555.        once, not recursively.  Thus, writing:
  2556.  
  2557.             ["[a+b]"]
  2558.  
  2559.        causes RReemmiinndd to read the  token  "[a+b]".   It  does  not
  2560.        interpret  this  as  a pasted-in expression.  In fact, the
  2561.        only way to get a literal left-bracket into a reminder  is
  2562.        to use ["["].
  2563.  
  2564.        You  can use expression pasting almost anywhere.  However,
  2565.        there are a few exceptions:
  2566.  
  2567.        o      If RReemmiinndd is expecting an expression, as in the SSEETT
  2568.               command,  or  the  IIFF  command,  then no expression
  2569.  
  2570.  
  2571.  
  2572.                          13 October 1993                       39
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. REMIND(1)                                               REMIND(1)
  2579.  
  2580.  
  2581.               pasting takes  place.   The  expression  is  simply
  2582.               evaluated as if the square brackets were not there.
  2583.  
  2584.        o      You cannot use expression  pasting  for  the  first
  2585.               token  on  a line.  For example, the following will
  2586.               not work:
  2587.  
  2588.                  ["SET"] a 1
  2589.  
  2590.               This restriction is because RReemmiinndd must be able  to
  2591.               unambiguously  determine  the first token of a line
  2592.               for the  flow-control  commands  (to  be  discussed
  2593.               later.)
  2594.  
  2595.               In fact, if RReemmiinndd cannot determine the first token
  2596.               on a line, it assumes that it is a RREEMM command.  If
  2597.               expression-pasting  is used, RReemmiinndd assumes it is a
  2598.               RREEMM command.  Thus, the  following  three  commands
  2599.               are equivalent:
  2600.  
  2601.                         REM 12 Nov 1993 AT 13:05 MSG BOO!
  2602.                         12 Nov 1993 AT 13:05 MSG BOO!
  2603.                         [12] ["Nov " + 1993] AT [12:05+60] MSG BOO!
  2604.  
  2605.        o      You  cannot use expression-pasting to determine the
  2606.               type (MMSSGG, CCAALL, etc.) of a RREEMM  command.   You  can
  2607.               paste  expressions  before  and  after the MMSSGG, etc
  2608.               keywords, but cannot do something like this:
  2609.  
  2610.                  REM ["12 Nov 1993 AT 13:05 " + "MSG" + " BOO!"]
  2611.  
  2612.        CCOOMMMMOONN PPIITTFFAALLLLSS IINN EEXXPPRREESSSSIIOONN PPAASSTTIINNGG
  2613.  
  2614.        Remember, when pasting in expressions, that  extra  spaces
  2615.        are not inserted.  Thus, something like:
  2616.  
  2617.             REM[expr]MSG[expr]
  2618.  
  2619.        will probably fail.
  2620.  
  2621.        If  you  use  an  expression to calculate a _d_e_l_t_a or _b_a_c_k,
  2622.        ensure that the result is a  positive  number.   Something
  2623.        like:
  2624.  
  2625.             REM +[mydelta] Nov 12 1993 MSG foo
  2626.  
  2627.        will fail if _m_y_d_e_l_t_a happens to be negative.
  2628.  
  2629.  
  2630. FFLLOOWW CCOONNTTRROOLL CCOOMMMMAANNDDSS
  2631.        RReemmiinndd  has  commands which control the flow of a reminder
  2632.        script.  Normally, reminder scripts are processed  sequen-
  2633.        tially.   However,  IIFF  and  related commands allow you to
  2634.        process files conditionally, and skip sections  which  you
  2635.  
  2636.  
  2637.  
  2638.                          13 October 1993                       40
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644. REMIND(1)                                               REMIND(1)
  2645.  
  2646.  
  2647.        don't want interpreted.
  2648.  
  2649.        TTHHEE IIFF CCOOMMMMAANNDD
  2650.  
  2651.        The IIFF command has the following form:
  2652.  
  2653.             IF expr
  2654.                  t-command
  2655.                  t-command...
  2656.             ELSE
  2657.                  f-command
  2658.                  f-command...
  2659.             ENDIF
  2660.  
  2661.        Note  that  the  commands  are shown indented for clarity.
  2662.        Also, the EELLSSEE portion can be omitted.  IIFF commands can be
  2663.        nested up to a small limit, probably around 8 or 16 levels
  2664.        of nesting, depending on your system.
  2665.  
  2666.        If the _e_x_p_r evaluates to a non-zero  IINNTT,  or  a  non-null
  2667.        SSTTRRIINNGG, then the IIFF portion is considered true, and the _t_-
  2668.        _c_o_m_m_a_n_d_s are executed.  If _e_x_p_r evaluates to zero or null,
  2669.        then  the  _f_-_c_o_m_m_a_n_d_s (if the EELLSSEE portion is present) are
  2670.        executed.  If _e_x_p_r is not of type IINNTT or SSTTRRIINNGG,  then  it
  2671.        is an error.
  2672.  
  2673.        Examples:
  2674.  
  2675.             IF defined("want_hols")
  2676.                  INCLUDE /usr/share/remind/holidays
  2677.             ENDIF
  2678.  
  2679.             IF today() > '1992/2/10'
  2680.                  set missed_ap "You missed it!"
  2681.             ELSE
  2682.                  set missed_ap "Still have time..."
  2683.             ENDIF
  2684.  
  2685.        TTHHEE IIFFTTRRIIGG CCOOMMMMAANNDD
  2686.  
  2687.        The  IIFFTTRRIIGG  command  is  similar to an IIFF command, except
  2688.        that it computes a trigger (as in the  RREEMM  command),  and
  2689.        evaluates  to  true  if  a corresponding RREEMM command would
  2690.        trigger.  Examples:
  2691.  
  2692.             IFTRIG 1 Nov
  2693.                  ; Executed on 1 Nov
  2694.             ELSE
  2695.                  ; Executed except on 1 Nov
  2696.             ENDIF
  2697.  
  2698.             IFTRIG 1 -1 OMIT Sat Sun +4
  2699.                  ; Executed on last working day of month,
  2700.                  ; and the 4 working days preceding it
  2701.  
  2702.  
  2703.  
  2704.                          13 October 1993                       41
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710. REMIND(1)                                               REMIND(1)
  2711.  
  2712.  
  2713.             ELSE
  2714.                  ; Executed except on above days
  2715.             ENDIF
  2716.  
  2717.        Note that the IIFFTTRRIIGG  command  computes  a  trigger  date,
  2718.        which  can be retrieved with the ttrriiggddaattee(()) function.  You
  2719.        can use all of the  normal  trigger  components,  such  as
  2720.        UUNNTTIILL, _d_e_l_t_a, etc in the IIFFTTRRIIGG command.
  2721.  
  2722.  
  2723. UUSSEERR--DDEEFFIINNEEDD FFUUNNCCTTIIOONNSS
  2724.        In  addition  to the built-in functions, RReemmiinndd allows you
  2725.        to define your own functions.  The FFSSEETT command does  this
  2726.        for you:
  2727.  
  2728.        FFSSEETT _f_n_a_m_e(_a_r_g_s) _e_x_p_r
  2729.  
  2730.        _F_n_a_m_e is the name of the function, and follows the conven-
  2731.        tion for naming variables.  _A_r_g_s is a comma-separated list
  2732.        of  arguments,  and  _e_x_p_r  is  an expression.  _A_r_g_s can be
  2733.        empty, in which case  you  define  a  function  taking  no
  2734.        parameters.  Here are some examples:
  2735.  
  2736.             FSET double(x) 2*x
  2737.             FSET yeardiff(date1, date2) year(date1) - year(date2)
  2738.             FSET since(x) ord(year(trigdate())-x)
  2739.  
  2740.        The  last  function  is useful in birthday reminders.  For
  2741.        example:
  2742.  
  2743.             REM 1 Nov +12 MSG Dean's [since(1984)] birthday is %b.
  2744.  
  2745.        Dean was born in 1984.  The above example, on  1  November
  2746.        1992, would print:
  2747.  
  2748.             Dean's 8th birthday is today.
  2749.  
  2750.        Notes:
  2751.  
  2752.        o      If  you  access  a variable in _e_x_p_r which is not in
  2753.               the list of arguments, the "global" value (if  any)
  2754.               is used.
  2755.  
  2756.        o      Function  and  parameter names are significant only
  2757.               to 12 characters.
  2758.  
  2759.        o      The vvaalluuee(()) function _a_l_w_a_y_s accesses  the  "global"
  2760.               value  of  a variable, even if it has the same name
  2761.               as an argument.  For example:
  2762.  
  2763.                         fset func(x) value("x")
  2764.                         set x 1
  2765.                         set y func(5)
  2766.  
  2767.  
  2768.  
  2769.  
  2770.                          13 October 1993                       42
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. REMIND(1)                                               REMIND(1)
  2777.  
  2778.  
  2779.               The above sequence sets y to 1, which is the global
  2780.               value of x.
  2781.  
  2782.        o      User-defined  functions  may  call other functions,
  2783.               including other user-defined  functions.   However,
  2784.               recursive calls are not allowed.
  2785.  
  2786.        o      User-defined  functions are not syntax-checked when
  2787.               they are defined; parsing occurs only when they are
  2788.               called.
  2789.  
  2790.        o      If  a  user-defined function has the same name as a
  2791.               built-in function, it is ignored and  the  built-in
  2792.               function is used.  To prevent conflicts with future
  2793.               versions of RReemmiinndd (which may define more  built-in
  2794.               functions),  you  may wish to name all user-defined
  2795.               functions beginning with an underscore.
  2796.  
  2797.  
  2798. PPRREECCIISSEE SSCCHHEEDDUULLIINNGG
  2799.        The SSCCHHEEDD keyword allows precise control over the schedul-
  2800.        ing of timed reminders.  It should be followed by the name
  2801.        of a user-defined function, _s_c_h_e_d___f_u_n_c_t_i_o_n.
  2802.  
  2803.        If a scheduling function is supplied, then  it  must  take
  2804.        one  argument of type IINNTT.  Rather than using the AATT time,
  2805.        time _d_e_l_t_a, and time _r_e_p_e_a_t, RReemmiinndd calls  the  scheduling
  2806.        function  to  determine when to trigger the reminder.  The
  2807.        first time the reminder is queued, the scheduling function
  2808.        is  called  with an argument of 1.  Each time the reminder
  2809.        is triggered, it is re-scheduled by calling the scheduling
  2810.        function again.  On each call, the argument is incremented
  2811.        by one.
  2812.  
  2813.        The return value of the scheduling function must be an IINNTT
  2814.        or  a  TTIIMMEE.   If  the  return  value  is a TTIIMMEE, then the
  2815.        reminder is re-queued to trigger at that time.  If it is a
  2816.        positive  integer  _n,  then  the  reminder is re-queued to
  2817.        trigger at the  previous  trigger  time  plus  _n  minutes.
  2818.        Finally,  if  it  is  a negative integer or zero, then the
  2819.        reminder is re-queued to trigger _n minutes before  the  AATT
  2820.        time.   Note that there must be an AATT clause for the SSCCHHEEDD
  2821.        clause to do anything.
  2822.  
  2823.        Here's an example:
  2824.  
  2825.             FSET _sfun(x) choose(x, -60, 30, 15, 10, 3, 1, 1, 1, 1, 0)
  2826.             REM AT 13:00 SCHED _sfun MSG foo
  2827.  
  2828.        The reminder would first be triggered at 13:00-60 minutes,
  2829.        or at 12:00.  It would next be triggered 30 minutes later,
  2830.        at 12:30.  Then, it would be triggered  at  12:45,  12:55,
  2831.        12:58, 12:59, 13:00, 13:01 and 13:02.
  2832.  
  2833.  
  2834.  
  2835.  
  2836.                          13 October 1993                       43
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842. REMIND(1)                                               REMIND(1)
  2843.  
  2844.  
  2845.        NNOOTTEESS
  2846.  
  2847.        1      If   an  error  occurs  during  the  evaluation  of
  2848.               _s_c_h_e_d___f_u_n_c, then RReemmiinndd reverts  to  using  the  AATT
  2849.               time  and  the  _d_e_l_t_a  and _r_e_p_e_a_t values, and never
  2850.               calls _s_c_h_e_d___f_u_n_c again.
  2851.  
  2852.        2      If processing _s_c_h_e_d___f_u_n_c yields a time earlier than
  2853.               the  current  system  time, it is repeatedly called
  2854.               with increasing argument until it  yields  a  value
  2855.               greater  than  or  equal to the current time.  How-
  2856.               ever, if the sequence of values  calculated  during
  2857.               the  repetition  is  not  strictly increasing, then
  2858.               RReemmiinndd reverts to the default behaviour  and  never
  2859.               calls _s_c_h_e_d___f_u_n_c again.
  2860.  
  2861.        3      It is quite possible using _s_c_h_e_d___f_u_n_c to keep trig-
  2862.               gering a reminder even after the AATT-time.  However,
  2863.               it  is  not  possible to reschedule a reminder past
  2864.               midnight  -  no  crossing  of  date  boundaries  is
  2865.               allowed.  Also, it is quite possible to nnoott trigger
  2866.               a reminder on the AATT time when you use a scheduling
  2867.               function.   However, if your scheduling function is
  2868.               terminated (for reasons 1 and 2) before the AATT time
  2869.               of  the  reminder,  it  _w_i_l_l be triggered at the AATT
  2870.               time, because normal processing takes over.
  2871.  
  2872.        4      Your scheduling functions should (as  a  matter  of
  2873.               good  style)  return  0  when no more scheduling is
  2874.               required.  See the example.
  2875.  
  2876.        5      All scheduling functions are  evaluated  _a_f_t_e_r  the
  2877.               entire Remind script has been read in.  So whatever
  2878.               function definitions are in effect at  the  end  of
  2879.               the script are used.
  2880.  
  2881.  
  2882. TTHHEE SSAATTIISSFFYY CCLLAAUUSSEE
  2883.        The form of RREEMM which uses SSAATTIISSFFYY is as follows:
  2884.  
  2885.        RREEMM _t_r_i_g_g_e_r SSAATTIISSFFYY _e_x_p_r
  2886.  
  2887.        The way this works is as follows:  RReemmiinndd first calculates
  2888.        a trigger date, in the  normal  fashion.   Next,  it  sets
  2889.        ttrriiggddaattee(()) to the calculated trigger date.  It then evalu-
  2890.        ates _e_x_p_r.  If the result is not the null string or  zero,
  2891.        processing  ends.   Otherwise,  RReemmiinndd  computes  the next
  2892.        trigger date, and re-tests _e_x_p_r.  This iteration continues
  2893.        until _e_x_p_r evaluates to non-zero or non-null, or until the
  2894.        iteration limit specified with the --xx command-line  option
  2895.        is reached.
  2896.  
  2897.        If  _e_x_p_r  is  not satisfied, then ttrriiggvvaalliidd(()) is set to 0.
  2898.        Otherwise, ttrriiggvvaalliidd(()) is set to  1.   In  any  event,  no
  2899.  
  2900.  
  2901.  
  2902.                          13 October 1993                       44
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908. REMIND(1)                                               REMIND(1)
  2909.  
  2910.  
  2911.        error message is issued.
  2912.  
  2913.        This  is really useful only if _e_x_p_r involves a call to the
  2914.        ttrriiggddaattee(()) function; otherwise, _e_x_p_r will  not  change  as
  2915.        RReemmiinndd iterates.
  2916.  
  2917.        An example of the usefulness of SSAATTIISSFFYY:  Suppose you wish
  2918.        to be warned of every Friday the 13th.  Your first attempt
  2919.        may be:
  2920.  
  2921.             # WRONG!
  2922.             REM Fri 13 +2 MSG Friday the 13th is %b.
  2923.  
  2924.        But  this won't work.  This reminder triggers on the first
  2925.        Friday on or after the 13th of each month.  The way to  do
  2926.        it is with a more complicated sequence:
  2927.  
  2928.             REM 13 SATISFY wkdaynum(trigdate()) == 5
  2929.             IF trigvalid()
  2930.                  REM [trigger(trigdate())] +2 MSG \
  2931.                  Friday the 13th is %b.
  2932.             ENDIF
  2933.  
  2934.        Let's  see  how  this  works.  The SSAATTIISSFFYY clause iterates
  2935.        through all the 13ths of successive months, until a  trig-
  2936.        ger  date is found whose day-of-week is Friday (== 5).  If
  2937.        a valid date was found, we use the calculated trigger date
  2938.        (converted  into a trigger format with the ttrriiggggeerr(()) func-
  2939.        tion) to set up the next reminder.
  2940.  
  2941.        We could also have written:
  2942.  
  2943.             REM Fri SATISFY day(trigdate()) == 13
  2944.  
  2945.        but this would result in more iterations, since  "Fridays"
  2946.        occur more often than "13ths of the month."
  2947.  
  2948.        This  technique  of  using  one RREEMM command to calculate a
  2949.        trigger date to be used by another command is quite power-
  2950.        ful.   For example, suppose you wanted to OMIT Labour day,
  2951.        which is the first Monday in September.  You could use:
  2952.  
  2953.             # Note: SATISFY 1 is an idiom for "do nothing"
  2954.             REM Mon 1 Sept SATISFY 1
  2955.             OMIT [trigger(trigdate())]
  2956.  
  2957.        CCAAVVEEAATT:: This _o_n_l_y omits  the  _n_e_x_t  Labour  Day,  not  all
  2958.        Labour  Days  in  the  future.   This  could cause strange
  2959.        results, as the OOMMIITT context can change depending  on  the
  2960.        current  date.  For example, if you use the following com-
  2961.        mand after the above commands:
  2962.  
  2963.             REM Mon AFTER msg hello
  2964.  
  2965.  
  2966.  
  2967.  
  2968.                          13 October 1993                       45
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974. REMIND(1)                                               REMIND(1)
  2975.  
  2976.  
  2977.        the result will not be as you expect.  Consider  producing
  2978.        a calendar for September, 1992.  Labour Day was on Monday,
  2979.        7 September, 1992.  However, when RReemmiinndd  gets  around  to
  2980.        calculating  the  trigger  for Tuesday, 8 September, 1992,
  2981.        the OOMMIITT command will now be omitting Labour Day for 1993,
  2982.        and  the  "Mon AFTER" command will not be triggered.  (But
  2983.        see the description of SSCCAANNFFRROOMM in  the  section  "Details
  2984.        about Trigger Computation.")
  2985.  
  2986.        It is probably best to stay away from computing OOMMIITT trig-
  2987.        ger dates unless you keep these pitfalls in mind.
  2988.  
  2989.        For versions of RReemmiinndd starting  from  03.00.07,  you  can
  2990.        include  a  MMSSGG,  RRUUNN,  etc. clause in a SSAATTIISSFFYY clause as
  2991.        follows:
  2992.  
  2993.             REM trigger_stuff SATISFY [expr] MSG body
  2994.  
  2995.        Note that for this case only, the _e_x_p_r after SSAATTIISSFFYY  _m_u_s_t
  2996.        be  enclosed  in braces.  It must come after all the other
  2997.        components of the trigger, and immediately before the MMSSGG,
  2998.        RRUUNN,  etc. keyword.  If _e_x_p_r cannot be satisfied, then the
  2999.        reminder is not triggered.
  3000.  
  3001.        Thus, the "Friday the 13th" example can be expressed  more
  3002.        compactly as:
  3003.  
  3004.             REM 13 +2 SATISFY [wkdaynum(trigdate()) == 5] \
  3005.                  MSG Friday the 13th is %b.
  3006.  
  3007.        And  you can trigger a reminder on Mondays, Wednesdays and
  3008.        Thursdays occurring on odd-numbered days of the month with
  3009.        the following:
  3010.  
  3011.             REM Mon Wed Thu SATISFY [day(trigdate())%2] \
  3012.                  MSG Here it is!!!
  3013.  
  3014.  
  3015. DDEEBBUUGGGGIINNGG RREEMMIINNDDEERR SSCCRRIIPPTTSS
  3016.        Although  the  command-line --dd option is useful for debug-
  3017.        ging, it is often overkill.  For example, if you  turn  on
  3018.        the  --ddxx  option  for  a  reminder  file with many complex
  3019.        expressions, you'll get a  huge  amount  of  output.   The
  3020.        DDEEBBUUGG  command  allows  you to control the debugging flags
  3021.        under program control.  The format is:
  3022.  
  3023.        DDEEBBUUGG [+_f_l_a_g_s_o_n] [-_f_l_a_g_s_o_f_f]
  3024.  
  3025.        _F_l_a_g_s_o_n and _f_l_a_g_s_o_f_f consist of strings of the  characters
  3026.        "extvl"  which  correspond  to  the debugging options dis-
  3027.        cussed in the command-line options section.   If  preceded
  3028.        with  a  "+", the corresponding group of debugging options
  3029.        is switched on.  Otherwise, they are  switched  off.   For
  3030.        example,   you   could   use  this  sequence  to  debug  a
  3031.  
  3032.  
  3033.  
  3034.                          13 October 1993                       46
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040. REMIND(1)                                               REMIND(1)
  3041.  
  3042.  
  3043.        complicated expression:
  3044.  
  3045.             DEBUG +x
  3046.             set a very_complex_expression(many_args)
  3047.             DEBUG -x
  3048.  
  3049.        TTHHEE DDUUMMPPVVAARRSS CCOOMMMMAANNDD
  3050.  
  3051.        The command DDUUMMPPVVAARRSS displays the values of  variables  in
  3052.        memory.  Its format is:
  3053.  
  3054.        DDUUMMPPVVAARRSS [_v_a_r...]
  3055.  
  3056.        If  you  supply  a space-separated list of variable names,
  3057.        the corresponding variables are displayed.  If you do  not
  3058.        supply  a  list of variables, then all variables in memory
  3059.        are displayed.  To dump a system variable, put its name in
  3060.        the  list  of variables to dump.  If you put a lone dollar
  3061.        sign in the list of variables to  dump,  then  all  system
  3062.        variables will be dumped.
  3063.  
  3064.        TTHHEE EERRRRMMSSGG CCOOMMMMAANNDD
  3065.  
  3066.        The EERRRRMMSSGG command has the following format:
  3067.  
  3068.        EERRRRMMSSGG _b_o_d_y
  3069.  
  3070.        The  _b_o_d_y  is passed through the substitution filter (with
  3071.        an implicit trigger date of ttooddaayy(())) and  printed  to  the
  3072.        error output stream.  Example:
  3073.  
  3074.             IF !defined("critical_var")
  3075.                  ERRMSG You must supply a value for "critical_var"
  3076.                  EXIT
  3077.             ENDIF
  3078.  
  3079.        TTHHEE EEXXIITT CCOOMMMMAANNDD
  3080.  
  3081.        The  above example also shows the use of the EEXXIITT command.
  3082.        This causes an unconditional exit from script  processing.
  3083.        Any  queued  timed reminders are discarded.  If you are in
  3084.        calendar mode (described next), then the calendar process-
  3085.        ing is aborted.
  3086.  
  3087.        If  you  supply an IINNTT-type expression after the EEXXIITT com-
  3088.        mand, it is returned to the calling program  as  the  exit
  3089.        status.  Otherwise, an exit status of 99 is returned.
  3090.  
  3091.        TTHHEE FFLLUUSSHH CCOOMMMMAANNDD
  3092.  
  3093.        This  command  simply consists of the word FFLLUUSSHH on a line
  3094.        by itself.  The command flushes the  standard  output  and
  3095.        standard error streams used by RReemmiinndd.  This is not terri-
  3096.        bly useful to most people, but may be useful  if  you  run
  3097.  
  3098.  
  3099.  
  3100.                          13 October 1993                       47
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106. REMIND(1)                                               REMIND(1)
  3107.  
  3108.  
  3109.        RReemmiinndd as a subprocess of another program, and want to use
  3110.        pipes for communication.
  3111.  
  3112.  
  3113. CCAALLEENNDDAARR MMOODDEE
  3114.        If you supply the --cc, --ss or --pp command-line  option,  then
  3115.        RReemmiinndd  runs  in  "calendar  mode."   In this mode, RReemmiinndd
  3116.        interprets the script repeatedly, performing one iteration
  3117.        through  the  whole  file  for  each  day in the calendar.
  3118.        Reminders which trigger are saved in internal buffers, and
  3119.        then inserted into the calendar in the appropriate places.
  3120.  
  3121.        If you also supply the --aa option,  then  RReemmiinndd  will  not
  3122.        include timed reminders in the calendar.
  3123.  
  3124.        The  --pp option is used in conjunction with the rreemm22ppss pro-
  3125.        gram to produce a  calendar  in  PostScript  format.   For
  3126.        example,  the  following command will send PostScript code
  3127.        to standard output:
  3128.  
  3129.             remind -p .reminders | rem2ps
  3130.  
  3131.        You can print a PostScript calendar by piping this to  the
  3132.        llpprr command.
  3133.  
  3134.        If you have a reminder script called ".reminders", and you
  3135.        execute this command:
  3136.  
  3137.             remind -c .reminders jan 1993
  3138.  
  3139.        then RReemmiinndd executes the script 31 times,  once  for  each
  3140.        day  in  January.   Each  time  it executes the script, it
  3141.        increments the value  of  ttooddaayy(()).   Any  reminders  whose
  3142.        trigger  date  matches ttooddaayy(()) are entered into the calen-
  3143.        dar.
  3144.  
  3145.        MMSSGG and CCAALL-type reminders, by default, have their  entire
  3146.        body  inserted  into the calendar.  RRUUNN-type reminders are
  3147.        not normally inserted into the calendar.  However, if  you
  3148.        enclose  a  portion  of  the body in the %"...%" sequence,
  3149.        only that portion is inserted.  For example, consider  the
  3150.        following:
  3151.  
  3152.             REM 6 Jan MSG %"David's birthday%" is %b
  3153.  
  3154.        In  the  normal mode, RReemmiinndd would print "David's birthday
  3155.        is today" on 6 January.  However, in  the  calendar  mode,
  3156.        only  the text "David's birthday" is inserted into the box
  3157.        for 6 January.
  3158.  
  3159.        If you explicitly use the %"...%" sequence in  a  RRUUNN-type
  3160.        reminder, then the text between the delimiters is inserted
  3161.        into the calendar.  If you use the sequence %"%" in a  MMSSGG
  3162.        or  CCAALL-type  reminder, then no calendar entry is produced
  3163.  
  3164.  
  3165.  
  3166.                          13 October 1993                       48
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172. REMIND(1)                                               REMIND(1)
  3173.  
  3174.  
  3175.        for that reminder.
  3176.  
  3177.        PPRREESSEERRVVIINNGG VVAARRIIAABBLLEESS
  3178.  
  3179.        Because RReemmiinndd iterates through the script for each day in
  3180.        the  calendar,  slow  operations  may  severely reduce the
  3181.        speed of producing a calendar.
  3182.  
  3183.        For example, suppose you set the variables "me" and "host-
  3184.        name" as follows:
  3185.  
  3186.             SET me shell("whoami")
  3187.             SET hostname shell("hostname")
  3188.  
  3189.        Normally,  RReemmiinndd  clears all variables between iterations
  3190.        in calendar mode.  However, if certain variables are  slow
  3191.        to  compute,  and  will not change between iterations, you
  3192.        can "preserve" their values  with  the  PPRREESSEERRVVEE  command.
  3193.        Also,  since  function  definitions  are preserved between
  3194.        calendar iterations, there is no need to redefine them  on
  3195.        each   iteration.   Thus,  you  could  use  the  following
  3196.        sequence:
  3197.  
  3198.             IF ! defined("initialized")
  3199.                  set initialized 1
  3200.                  set me shell("whoami")
  3201.                  set hostname shell("hostname")
  3202.                  fset func(x) complex_expr
  3203.                  preserve initialized me hostname
  3204.             ENDIF
  3205.  
  3206.        The operation is  as  follows:   On  the  first  iteration
  3207.        through  the  script, "initialized" is not defined.  Thus,
  3208.        the commands between IIFF and EENNDDIIFF are executed.  The  PPRREE--
  3209.        SSEERRVVEE  command  ensures that the values of initialized, me
  3210.        and hostname are preserved for subsequent iterations.   On
  3211.        the  next  iteration, the commands are skipped, since ini-
  3212.        tialized has remained defined.  Thus, time-consuming oper-
  3213.        ations  which  do  not  depend on the value of ttooddaayy(()) are
  3214.        done only once.
  3215.  
  3216.        System variables (those whose names start  with  '$')  are
  3217.        automatically preserved between calendar iterations.
  3218.  
  3219.        Note  that  for  efficiency,  RReemmiinndd  caches  the reminder
  3220.        script (and any IINNCCLLUUDDEEd files) in memory when producing a
  3221.        calendar.
  3222.  
  3223.        Timed reminders are sorted and placed into the calendar in
  3224.        time order.  These are followed  by  non-timed  reminders.
  3225.        RReemmiinndd automatically places the time of timed reminders in
  3226.        the calendar according  to  the  --bb  command-line  option.
  3227.        Reminders  in calendar mode are sorted as if the --gg option
  3228.        had been used; you can change the sort order  in  calendar
  3229.  
  3230.  
  3231.  
  3232.                          13 October 1993                       49
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238. REMIND(1)                                               REMIND(1)
  3239.  
  3240.  
  3241.        mode  by  explicitly using the --gg option to specify a dif-
  3242.        ferent order from the default.
  3243.  
  3244.        RREEPPEEAATTEEDD EEXXEECCUUTTIIOONN
  3245.  
  3246.        If you supply a _r_e_p_e_a_t parameter on the command line,  and
  3247.        do not use the --cc, --pp, or --ss options, RReemmiinndd operates in a
  3248.        similar manner to calendar mode.  It  repeatedly  executes
  3249.        the reminder script, incrementing ttooddaayy(()) with each itera-
  3250.        tion.  The same rules about preserving variables and func-
  3251.        tion  definitions  apply.   Note  that using _r_e_p_e_a_t on the
  3252.        command line also enables the --qq option and  disables  any
  3253.        --zz  option.   As an example, if you want to see how RReemmiinndd
  3254.        will behave for the next week, you can type:
  3255.  
  3256.             remind .reminders '*7'
  3257.  
  3258.        If you want to print the dates of the next 1000 days, use:
  3259.  
  3260.             (echo 'banner %'; echo 'msg [today()]%') | remind - '*1000'
  3261.  
  3262.  
  3263. IINNIITTIIAALLIIZZIINNGG VVAARRIIAABBLLEESS OONN TTHHEE CCOOMMMMAANNDD LLIINNEE
  3264.        The  --ii  option  is  used  to  initialize variables on the
  3265.        RReemmiinndd command line.  The format is --ii_v_a_r==_e_x_p_r, where _e_x_p_r
  3266.        is  any  valid  expression.  Note that you may have to use
  3267.        quotes or escapes to prevent the shell  from  interpreting
  3268.        special  characters  in  _e_x_p_r.   You  can  have as many --ii
  3269.        options as you want on the command line, and they are pro-
  3270.        cessed in order.  Thus, if a variable is defined in one --ii
  3271.        option, it can be referred to by subsequent --ii options.
  3272.  
  3273.        Note that if you supply a date on the command line, it  is
  3274.        not  parsed  until all options have been processed.  Thus,
  3275.        if you use ttooddaayy(()) in any of the --ii expressions,  it  will
  3276.        return the same value as rreeaallttooddaayy(()) and not the date sup-
  3277.        plied on the command line.
  3278.  
  3279.        Any variables defined on the command line are pprreesseerrvveedd as
  3280.        with the PPRREESSEERRVVEE command.
  3281.  
  3282.        You  should  not have any spaces between the --ii option and
  3283.        the equal sign; otherwise, strange variable names are cre-
  3284.        ated  which  can  only  be  accessed  with  the vvaalluuee(()) or
  3285.        ddeeffiinneedd(()) functions.
  3286.  
  3287.        If your site uses the  RReemmiinndd--aallll  shell  script  to  mail
  3288.        reminders  to  users, the script will initialize the vari-
  3289.        able _r_e_m_i_n_d___a_l_l to 1 using the --ii option.  Thus,  you  can
  3290.        detect  when  your  reminder  script is being processed by
  3291.        RReemmiinndd--aallll and can use this information to  control  which
  3292.        reminders you want mailed to you.
  3293.  
  3294.  
  3295.  
  3296.  
  3297.  
  3298.                          13 October 1993                       50
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304. REMIND(1)                                               REMIND(1)
  3305.  
  3306.  
  3307. MMOORREE AABBOOUUTT PPOOSSTTSSCCRRIIPPTT
  3308.        The  PPSS and PPSSFFIILLEE reminders pass PostScript code directly
  3309.        to the printer.  They differ in that the PPSS-type  reminder
  3310.        passes  its  body directly to the PostScript output (after
  3311.        processing by the substitution filter) while  the  PPSSFFIILLEE-
  3312.        type's  body  should  simply  consist  of a filename.  The
  3313.        RReemm22ppss program will open the file named in the PPSSFFIILLEE-type
  3314.        reminder,  and include its contents in the PostScript out-
  3315.        put.
  3316.  
  3317.        The PostScript-type reminders for  a  particular  day  are
  3318.        included  in the PostScript output in sorted order of pri-
  3319.        ority.  Note that the order of PostScript commands  has  a
  3320.        _m_a_j_o_r  impact  on  the  appearance  of the calendars.  For
  3321.        example, PostScript code to  shade  a  calendar  box  will
  3322.        obliterate  code  to draw a moon symbol if the moon symbol
  3323.        code is placed in the calendar first.   For  this  reason,
  3324.        you  should  not  provide PPSS or PPSSFFIILLEE-type reminders with
  3325.        priorities; instead, you should ensure that they appear in
  3326.        the reminder script in the correct order.  PostScript code
  3327.        should draw objects working from  the  background  to  the
  3328.        foreground,  so  that  foreground objects properly overlay
  3329.        background ones.  If you prioritize  these  reminders  and
  3330.        run the script using descending sort order for priorities,
  3331.        the PostScript output will not work.
  3332.  
  3333.        All of the  PostScript  code  for  a  particular  date  is
  3334.        enclosed  in  a  ssaavvee-rreessttoorree  pair.   However, if several
  3335.        PostScript-type reminders are triggered for a single  day,
  3336.        each  section  of  PostScript  is  not enclosed in a ssaavvee-
  3337.        rreessttoorree pair  -  instead,  the  entire  body  of  included
  3338.        PostScript is enclosed.
  3339.  
  3340.        PostScript-type  reminders  are executed by the PostScript
  3341.        printer before any regular calendar entries.  Thus,  regu-
  3342.        lar  calendar  entries  will  overlay  the PostScript-type
  3343.        reminders, allowing you  to  create  shaded  or  graphical
  3344.        backgrounds for particular days.
  3345.  
  3346.        Before  executing  your PostScript code, the origin of the
  3347.        PostScript coordinate system is positioned to  the  bottom
  3348.        left-hand corner of the "box" in the calendar representing
  3349.        ttooddaayy(()).  This location is exactly in the  middle  of  the
  3350.        intersection  of the bottom and left black lines delineat-
  3351.        ing the box - you may have to account for the thickness of
  3352.        these lines when calculating positions.
  3353.  
  3354.        Several   PostScript   variables   are  available  to  the
  3355.        PostScript code you supply.  All distance and  size  vari-
  3356.        ables  are in PostScript units (1/72 inch.)  The variables
  3357.        are:
  3358.  
  3359.        LineWidth
  3360.               The width of the black grid  lines  making  up  the
  3361.  
  3362.  
  3363.  
  3364.                          13 October 1993                       51
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370. REMIND(1)                                               REMIND(1)
  3371.  
  3372.  
  3373.               calendar.
  3374.  
  3375.        Border The border between the center of the grid lines and
  3376.               the space used to  print  calendar  entries.   This
  3377.               border is normally blank space.
  3378.  
  3379.        BoxWidth and BoxHeight
  3380.               The width and height of the calendar box, from cen-
  3381.               ter-to-center of the black gridlines.
  3382.  
  3383.        InBoxHeight
  3384.               The height from the  center  of  the  bottom  black
  3385.               gridline  to  the top of the regular calendar entry
  3386.               area.  The space from here to the top of the box is
  3387.               used only to draw the day number.
  3388.  
  3389.        /DayFont, /EntryFont, /SmallFont, /TitleFont and /HeadFont
  3390.               The fonts used to draw the day numbers, the  calen-
  3391.               dar  entries,  the  small  calendars,  the calendar
  3392.               title (month, year) and the  day-of-the-week  head-
  3393.               ings, respectively.
  3394.  
  3395.        DaySize, EntrySize, TitleSize and HeadSize
  3396.               The  sizes  of  the  above fonts.  (The size of the
  3397.               small calendar font  is  _n_o_t  defined  here.)   For
  3398.               example,  if  you  wanted  to print the Hebrew date
  3399.               next to the regular day  number  in  the  calendar,
  3400.               use:
  3401.  
  3402.             REM PS Border BoxHeight Border sub DaySize sub moveto \
  3403.                /DayFont findfont DaySize scalefont setfont \
  3404.                ([hebday(today())] [hebmon(today())]) show
  3405.  
  3406.               Note how /DayFont and DaySize are used.
  3407.  
  3408.        Note that if you supply PostScript code, it is possible to
  3409.        produce  invalid  PostScript  files.   Always  test   your
  3410.        PostScript  thoroughly  with  a  PostScript  viewer before
  3411.        sending it to the printer.  You should not use  any  docu-
  3412.        ment structuring comments in your PostScript code.
  3413.  
  3414.  
  3415. DDAAEEMMOONN MMOODDEE
  3416.        If  you use the --zz command-line option, RReemmiinndd runs in the
  3417.        "daemon" mode.  In this mode, no  "normal"  reminders  are
  3418.        issued.   Instead,  only timed reminders are collected and
  3419.        queued, and are then  issued  whenever  they  reach  their
  3420.        trigger time.
  3421.  
  3422.        In  addition,  RReemmiinndd  wakes up every few minutes to check
  3423.        the modification date on the reminder script (the filename
  3424.        supplied on the command line.)  If RReemmiinndd detects that the
  3425.        script has changed, it re-executes itself in daemon  mode,
  3426.        and interprets the changed script.
  3427.  
  3428.  
  3429.  
  3430.                          13 October 1993                       52
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436. REMIND(1)                                               REMIND(1)
  3437.  
  3438.  
  3439.        In  daemon  mode,  RReemmiinndd  also re-reads the remind script
  3440.        when it detects that the system date has changed.
  3441.  
  3442.        In daemon mode, RReemmiinndd acts as if the --ff option  had  been
  3443.        used, so to run in the daemon mode in the background, use:
  3444.  
  3445.             remind -z .reminders &
  3446.  
  3447.        If you use sshh or bbaasshh, you may have  to  use  the  "nohup"
  3448.        command  to  ensure that the daemon is not killed when you
  3449.        log out.
  3450.  
  3451.  
  3452. SSOORRTTIINNGG RREEMMIINNDDEERRSS
  3453.        The --gg option causes RReemmiinndd to sort reminders  by  trigger
  3454.        date,  time  and  priority before issuing them.  Note that
  3455.        reminders are still calculated in the order encountered in
  3456.        the  script.   However,  rather  than being issued immedi-
  3457.        ately, they are saved in an internal buffer.  When  RReemmiinndd
  3458.        has  finished  processing  the script, it issues the saved
  3459.        reminders in sorted order.  The --gg option can be  followed
  3460.        by  up to three characters, which must be "a" or "d".  The
  3461.        first character specifies the sort order by  trigger  date
  3462.        (ascending  or  descending), the second specifies the sort
  3463.        order by trigger time and the  third  specifies  the  sort
  3464.        order  by  priority.  The default is to sort all fields in
  3465.        ascending order.
  3466.  
  3467.        In ascending order, reminders are  issued  with  the  most
  3468.        imminent   first.    Descending   order  is  the  reverse.
  3469.        Reminders are always sorted by trigger date, and reminders
  3470.        with  the  same  trigger  date  are then sorted by trigger
  3471.        time.  Non-timed reminders are always issued  after  timed
  3472.        reminders  in  this  mode.  If two reminders have the same
  3473.        date and time, then the priority is used  to  break  ties.
  3474.        Reminders with the same date, time and priority are issued
  3475.        in the order they were encountered.
  3476.  
  3477.        You can define a user-defined function  called  SORTBANNER
  3478.        which  takes  one  DDAATTEE-type  argument.  In sort mode, the
  3479.        following sequence happens:
  3480.  
  3481.        If RReemmiinndd notices that the next reminder to  issue  has  a
  3482.        different  trigger date from the previous one (or if it is
  3483.        the first one to be issued),  then  SORTBANNER  is  called
  3484.        with  the  trigger  date  as  its argument.  The result is
  3485.        coerced to a string, and passed through  the  substitution
  3486.        filter  with  the appropriate trigger date.  The result is
  3487.        then displayed.
  3488.  
  3489.        Here's an example - consider the following fragment:
  3490.  
  3491.             # Switch off the normal banner
  3492.             BANNER %
  3493.  
  3494.  
  3495.  
  3496.                          13 October 1993                       53
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502. REMIND(1)                                               REMIND(1)
  3503.  
  3504.  
  3505.             REM 11 March 1993 ++1 MSG Not so important
  3506.             REM 17 March 1993 ++7 MSG Way in the future
  3507.             REM 10 March 1993 MSG Important Reminder
  3508.             REM 11 March 1993 ++1 MSG Not so important - B
  3509.             FSET sortbanner(x) iif(x == today(), \
  3510.                  "***** THINGS TO DO TODAY *****", \
  3511.                  "----- Things to do %b -----")
  3512.  
  3513.        Running this with the --ggaaaa option on 10  March  1993  pro-
  3514.        duces the following output:
  3515.  
  3516.             ***** THINGS TO DO TODAY *****
  3517.  
  3518.             Important Reminder
  3519.  
  3520.             ----- Things to do tomorrow -----
  3521.  
  3522.             Not so important
  3523.  
  3524.             Not so important - B
  3525.  
  3526.             ----- Things to do in 7 days' time -----
  3527.  
  3528.             Way in the future
  3529.  
  3530.        You  can  use  the  aarrggss(())  built-in function to determine
  3531.        whether or not SORTBANNER has been defined.   (This  could
  3532.        be  used, for example, to provide a default definition for
  3533.        SORTBANNER in a system-wide file included at  the  end  of
  3534.        the user's file.)  Here's an example:
  3535.  
  3536.             # Create a default sortbanner function if it hasn't already
  3537.             # been defined
  3538.             if args("sortbanner") != 1
  3539.                  fset sortbanner(x) "--- Things to do %b ---"
  3540.             endif
  3541.  
  3542.  
  3543. MMSSGGPPRREEFFIIXX(()) AANNDD MMSSGGSSUUFFFFIIXX(())
  3544.        You can define two functions in your script called mmssggpprree--
  3545.        ffiixx(()) and mmssggssuuffffiixx(()).  They should each accept one  argu-
  3546.        ment, a number from 0 to 9999.
  3547.  
  3548.        In  normal mode, for MMSSGG- and MMSSFF-type reminders, the fol-
  3549.        lowing sequence occurs when RReemmiinndd triggers a reminder:
  3550.  
  3551.        o      If mmssggpprreeffiixx(()) is defined, it is evaluated with the
  3552.               priority  of  the  reminder  as  its argument.  The
  3553.               result is printed.  It is _n_o_t  passed  through  the
  3554.               substitution filter.
  3555.  
  3556.        o      The body of the reminder is printed.
  3557.  
  3558.        o      If mmssggssuuffffiixx(()) is defined, it is evaluated with the
  3559.  
  3560.  
  3561.  
  3562.                          13 October 1993                       54
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568. REMIND(1)                                               REMIND(1)
  3569.  
  3570.  
  3571.               priority of the  reminder  as  its  argument.   The
  3572.               result  is  printed.   It is _n_o_t passed through the
  3573.               substitution filter.
  3574.  
  3575.        Here's an example:  The following definition causes prior-
  3576.        ity-0  reminders  to  be  preceded by "URGENT", and prior-
  3577.        ity-6000 reminders to be preceded by "(not important)".
  3578.  
  3579.             fset msgprefix(x) iif(x==0, "URGENT: ", \
  3580.                  x==6000, "(not important) ", "")
  3581.  
  3582.        In Calendar Mode (with the  --cc,  --ss  or  --pp  options),  an
  3583.        analagous  pair of functions named ccaallpprreeffiixx(()) and ccaallssuuff--
  3584.        ffiixx(()) can be defined.  They work with all reminders  which
  3585.        produce  an entry in the calendar (i.e., CCAALL- and possibly
  3586.        RRUUNN-type reminders as well as MMSSGG-type reminders.)
  3587.  
  3588.        NNOOTTEESS
  3589.  
  3590.        Normally, the body of a reminder is followed by a carriage
  3591.        return.   Thus,  the results of mmssggssuuffffiixx(()) will appear on
  3592.        the next line.  If you don't want this, end  the  body  of
  3593.        the  reminder  with a percentage sign, "%".  If you want a
  3594.        space between your reminders, simply  include  a  carriage
  3595.        return (cchhaarr((1133))) as part of the mmssggssuuffffiixx(()) return value.
  3596.  
  3597.        If RReemmiinndd has problems evaluating mmssggpprreeffiixx(()), mmssggssuuffffiixx(())
  3598.        or  ssoorrttbbaannnneerr(()),  you  will  see a lot of error messages.
  3599.        For an example of this, define the following:
  3600.  
  3601.             fset msgprefix(x) x/0
  3602.  
  3603.  
  3604. FFOORREEIIGGNN LLAANNGGUUAAGGEE SSUUPPPPOORRTT
  3605.        Your version of RReemmiinndd may have been compiled to support a
  3606.        language  other than English.  This support may or may not
  3607.        be complete - for example, all error  and  usage  messages
  3608.        may  still be in English.  However, at a minimum, foreign-
  3609.        language versions of RReemmiinndd will output  names  of  months
  3610.        and weekdays in the foreign language.  Also, the substitu-
  3611.        tion mechanism will substitute constructs suitable for the
  3612.        foreign language rather than for English.
  3613.  
  3614.        A  foreign-language  version  of RReemmiinndd will accept either
  3615.        the English or  foreign-language  names  of  weekdays  and
  3616.        months  in  a reminder script.  However, for compatibility
  3617.        between versions  of  RReemmiinndd,  you  should  use  only  the
  3618.        English names in your scripts.
  3619.  
  3620.  
  3621. TTHHEE HHEEBBRREEWW CCAALLEENNDDAARR
  3622.        RReemmiinndd  has  support  for  the Hebrew calendar, which is a
  3623.        luni-solar calendar.  This allows you to create  reminders
  3624.        for  Jewish  holidays, jahrzeits (anniversaries of deaths)
  3625.  
  3626.  
  3627.  
  3628.                          13 October 1993                       55
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634. REMIND(1)                                               REMIND(1)
  3635.  
  3636.  
  3637.        and smachot (joyous occasions.)
  3638.  
  3639.        TTHHEE HHEEBBRREEWW YYEEAARR
  3640.  
  3641.        The Hebrew year has 12 months, alternately 30 and 29  days
  3642.        long.   The  months  are: Tishrey, Heshvan, Kislev, Tevet,
  3643.        Shvat, Adar, Nisan, Iyar, Sivan, Tamuz, Av and  Elul.   In
  3644.        Biblical  times,  the  year  started  in  Nisan,  but Rosh
  3645.        Hashana (Jewish New Year) is now celebrated on the 1st and
  3646.        2nd of Tishrey.
  3647.  
  3648.        In  a  cycle  of  19  years, there are 7 leap years, being
  3649.        years 3, 6, 8, 11, 14, 17 and 19 of the cycle.  In a  leap
  3650.        year, an extra month of 30 days is added before Adar.  The
  3651.        two Adars are called Adar A and Adar B.
  3652.  
  3653.        For certain religious reasons, the year cannot start on  a
  3654.        Sunday, Wednesday or Friday.  To adjust for this, a day is
  3655.        taken off Kislev or added to  Heshvan.   Thus,  a  regular
  3656.        year  can  have from 353 to 355 days, and a leap year from
  3657.        383 to 385.
  3658.  
  3659.        When Kislev or Heshvan is short, it is called "chaser", or
  3660.        lacking.  When it is long, it is called "shalem", or full.
  3661.  
  3662.        The Jewish date changes at sunset.  However,  RReemmiinndd  will
  3663.        change the date at midnight, not sunset.  So in the period
  3664.        between sunset and midnight, Remind will be a day  earlier
  3665.        than  the  true Jewish date.  This should not be much of a
  3666.        problem in practice.
  3667.  
  3668.        The computations for the Jewish calendar were based on the
  3669.        program  "hdate" written by Amos Shapir of the Hebrew Uni-
  3670.        versity of Jerusalem, Israel.  He also supplied  the  pre-
  3671.        ceding explanation of the calendar.
  3672.  
  3673.        HHEEBBRREEWW DDAATTEE FFUUNNCCTTIIOONNSS
  3674.  
  3675.        hheebbddaayy((dd__ddaattee))
  3676.               Returns  the  day of the Hebrew month corresponding
  3677.               to the _d_a_t_e parameter.  For example, 12 April  1993
  3678.               corresponds   to   21   Nisan   5753.   Thus,  heb-
  3679.               day('1993/04/12') returns 21.
  3680.  
  3681.        hheebbmmoonn((dd__ddaattee))
  3682.               Returns the name of the Hebrew month  corresponding
  3683.               to _d_a_t_e.  For example, hebmon('1993/04/12') returns
  3684.               "Nisan".
  3685.  
  3686.        hheebbyyeeaarr((dd__ddaattee))
  3687.               Returns the Hebrew year corresponding to _d_a_t_e.  For
  3688.               example, hebyear('1993/04/12') returns 5753.
  3689.  
  3690.  
  3691.  
  3692.  
  3693.  
  3694.                          13 October 1993                       56
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700. REMIND(1)                                               REMIND(1)
  3701.  
  3702.  
  3703.        hheebbddaattee((ii__ddaayy,, ss__hheebbmmoonn [[,,iidd__yyrrssttaarrtt [[,,ii__jjaahhrr
  3704.               [[,,ii__aaffllaagg]]]]]]))
  3705.               The hheebbddaattee(()) function is the most complex  of  the
  3706.               Hebrew  support functions.  It can take from 2 to 5
  3707.               arguments.  It returns a DDAATTEE corresponding to  the
  3708.               Hebrew date.
  3709.  
  3710.               The _d_a_y parameter can range from 1 to 30, and spec-
  3711.               ifies the day of  the  Hebrew  month.   The  _h_e_b_m_o_n
  3712.               parameter  is  a  string which must name one of the
  3713.               Hebrew months specified above.  Note that the month
  3714.               must  be  spelled  out in full, and use the English
  3715.               transliteration shown  previously.   You  can  also
  3716.               specify "Adar A" and "Adar B."  Month names are not
  3717.               case-sensitive.
  3718.  
  3719.               The _y_r_s_t_a_r_t parameter can either be a  DDAATTEE  or  an
  3720.               IINNTT.  If it is a DDAATTEE, then the hheebbddaattee(()) scans for
  3721.               the first Hebrew date on or after that  date.   For
  3722.               example:
  3723.  
  3724.                         hebdate(15, "Nisan", '1990/01/01')
  3725.  
  3726.               returns  1990/03/30,  because  that  is  the  first
  3727.               occurrence of 15 Nisan on or after 1 January  1990.
  3728.  
  3729.               If _y_r_s_t_a_r_t is an IINNTT, it is interpreted as a Hebrew
  3730.               year.  Thus:
  3731.  
  3732.                         hebdate(22, "Kislev", 5756)
  3733.  
  3734.               returns 1995/12/15, because that  date  corresponds
  3735.               to  22  Kislev, 5756.  Note that none of the Hebrew
  3736.               date  functions  will  work  with   dates   outside
  3737.               RReemmiinndd''ss normal range for dates.
  3738.  
  3739.               If _y_r_s_t_a_r_t is not supplied, it defaults to ttooddaayy(()).
  3740.  
  3741.               The _j_a_h_r modifies the  behaviour  of  hheebbddaattee(())  as
  3742.               follows:
  3743.  
  3744.               If  _j_a_h_r  is  0 (the default), then hheebbddaattee(()) keeps
  3745.               scanning until it finds a date which exactly satis-
  3746.               fies the other parameters.  For example:
  3747.  
  3748.                         hebdate(30, "Adar A", 1993/01/01)
  3749.  
  3750.               returns  1995/03/02,  corresponding  to  30 Adar A,
  3751.               5755, because that is the  next  occurrence  of  30
  3752.               Adar  A  after  1 January, 1993.  This behaviour is
  3753.               appropriate for Purim Katan, which only appears  in
  3754.               leap years.
  3755.  
  3756.               If _j_a_h_r is 1, then the date is modified as follows:
  3757.  
  3758.  
  3759.  
  3760.                          13 October 1993                       57
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766. REMIND(1)                                               REMIND(1)
  3767.  
  3768.  
  3769.               o      30 Heshvan is converted to 1 Kislev in years
  3770.                      when Heshvan is chaser
  3771.  
  3772.               o      30  Kislev  is converted to 1 Tevet in years
  3773.                      when Kislev is chaser
  3774.  
  3775.               o      30 Adar A is converted to 1  Nisan  in  non-
  3776.                      leapyears
  3777.  
  3778.               o      Other  dates in Adar A are moved to the cor-
  3779.                      responding day in Adar in non-leapyears
  3780.  
  3781.               This behaviour is appropriate for  smachot  (joyous
  3782.               occasions)   and   for   some   jahrzeits   -   see
  3783.               "JAHRZEITS."
  3784.  
  3785.               if _j_a_h_r is 2, then the date is modified as follows:
  3786.  
  3787.               o      30 Kislev and 30 Heshvan are converted to 29
  3788.                      Kislev and 29 Heshvan, respectively, if  the
  3789.                      month is chaser
  3790.  
  3791.               o      30  Adar  A is converted to 30 Shvat in non-
  3792.                      leapyears
  3793.  
  3794.               o      Other dates in Adar A are moved to the  cor-
  3795.                      responding day in Adar in non-leapyears
  3796.  
  3797.               if  _j_a_h_r  is not 0, 1, or 2, it is interpreted as a
  3798.               Hebrew year, and the  behaviour  is  calculated  as
  3799.               described in the next section, "JAHRZEITS."
  3800.  
  3801.               The  _a_f_l_a_g  parameter modifies the behaviour of the
  3802.               function for dates in Adar during leap years.   The
  3803.               _a_f_l_a_g is _o_n_l_y used if _y_r_s_t_a_r_t is a DDAATTEE type (or is
  3804.               omitted, defaulting to ttooddaayy(()).)
  3805.  
  3806.               The _a_f_l_a_g only affects date calculations if  _h_e_b_m_o_n
  3807.               is specified as "Adar".  In leap years, the follow-
  3808.               ing algorithm is followed:
  3809.  
  3810.               o      If _a_f_l_a_g is 0, then the date is triggered in
  3811.                      Adar B.  This is the default.
  3812.  
  3813.               o      If _a_f_l_a_g is 1, then the date is triggered in
  3814.                      Adar  A.   This  may  be   appropriate   for
  3815.                      jahrzeits  in  the Ashkenazi tradition; con-
  3816.                      sult a rabbi.
  3817.  
  3818.               o      If _a_f_l_a_g is 2, then the date is triggered in
  3819.                      both Adar A and Adar B of a leap year.  Some
  3820.                      Ashkenazim perform jahrzeit in both  Adar  A
  3821.                      and Adar B.
  3822.  
  3823.  
  3824.  
  3825.  
  3826.                          13 October 1993                       58
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832. REMIND(1)                                               REMIND(1)
  3833.  
  3834.  
  3835.        JJAAHHRRZZEEIITTSS
  3836.  
  3837.        A  jahrzeit  is a yearly commemoration of someone's death.
  3838.        It normally takes place on the anniversary of  the  death,
  3839.        but may be delayed if burial is delayed - consult a rabbi.
  3840.  
  3841.        In addition, because some months change length, it is  not
  3842.        obvious which day the anniversary of a death is.  The fol-
  3843.        lowing rules are used:
  3844.  
  3845.        o      If the death occurred on 30 Heshvan, and Heshvan in
  3846.               the  year  after  the  death  is  chaser,  then the
  3847.               jahrzeit is observed on 29 Heshvan  in  years  when
  3848.               Heshvan  is  chaser.   Otherwise,  the  yahrzeit is
  3849.               observed on 1 Kislev when Heshvan is chaser.
  3850.  
  3851.        o      If the death occurred on 30 Kislev, and  Kislev  in
  3852.               the  year  after  the  death  is  chaser,  then the
  3853.               jahrzeit is observed on 29  Kislev  in  years  when
  3854.               Kislev  is  chaser.   Otherwise,  the  yahrzeit  is
  3855.               observed on 1 Tevet when Kislev is chaser.
  3856.  
  3857.        o      If the  death  occurred  on  1-29  Adar  A,  it  is
  3858.               observed on 1-29 Adar in non-leapyears.
  3859.  
  3860.        o      If  the death occurred on 30 Adar A, it is observed
  3861.               on 30 Shvat in a non-leapyear.
  3862.  
  3863.        Specifying a Hebrew year for the _j_a_h_r parameter causes the
  3864.        correct behaviour to be selected for a death in that year.
  3865.        You may also have to specify _a_f_l_a_g, depending on your tra-
  3866.        dition.
  3867.  
  3868.        The jahrzeit information was supplied by Frank Yellin, who
  3869.        quoted  "The  Comprehensive  Hebrew  Calendar"  by  Arthur
  3870.        Spier,  and  "Calendrical  Calculations" by E. M. Reingold
  3871.        and Nachum Dershowitz.
  3872.  
  3873.  
  3874. MMIISSCCEELLLLAANNEEOOUUSS
  3875.        CCOOMMMMAANNDD AABBBBRREEVVIIAATTIIOONNSS
  3876.  
  3877.        The following tokens can be abbreviated:
  3878.  
  3879.        o      RREEMM can be omitted - it  is  implied  if  no  other
  3880.               valid command is present.
  3881.  
  3882.        o      CCLLEEAARR--OOMMIITT--CCOONNTTEEXXTT --> CCLLEEAARR
  3883.  
  3884.        o      PPUUSSHH--OOMMIITT--CCOONNTTEEXXTT --> PPUUSSHH
  3885.  
  3886.        o      PPOOPP--OOMMIITT--CCOONNTTEEXXTT --> PPOOPP
  3887.  
  3888.        o      DDUUMMPPVVAARRSS --> DDUUMMPP
  3889.  
  3890.  
  3891.  
  3892.                          13 October 1993                       59
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898. REMIND(1)                                               REMIND(1)
  3899.  
  3900.  
  3901.        o      BBAANNNNEERR --> BBAANN
  3902.  
  3903.        o      IINNCCLLUUDDEE --> IINNCC
  3904.  
  3905.        o      SSCCAANNFFRROOMM --> SSCCAANN
  3906.  
  3907.        NNIIFFTTYY EEXXAAMMPPLLEESS
  3908.  
  3909.        This section is a sampling of what you can do with RReemmiinndd.
  3910.  
  3911.             REM 5 Feb 1991 AT 14:00 +45 *30 \
  3912.             RUN mail -s "Meeting at %2" $LOGNAME </dev/null &
  3913.  
  3914.        On 5 February, 1991, this reminder will mail you reminders
  3915.        of  a  2:00pm meeting at 1:15, 1:45 and 2:00.  The subject
  3916.        of the mail message will be "Meeting at  2:00pm"  and  the
  3917.        body of the message will be blank.
  3918.  
  3919.             REM AT 17:00 RUN echo "5:00pm - GO HOME!" | xless -g +0+0 &
  3920.  
  3921.        This  reminder will pop up an xless window at 5:00pm every
  3922.        day.  The xless window will contain the line "5:00pm -  GO
  3923.        HOME!"
  3924.  
  3925.             REM AT 23:59 RUN (sleep 120; remind -a [filename()]) &
  3926.  
  3927.        This reminder will run at one minute to midnight.  It will
  3928.        cause a new RReemmiinndd process to start  at  one  minute  past
  3929.        midnight.   This  allows you to have a continuous reminder
  3930.        service so you can work through the night  and  still  get
  3931.        timed  reminders for early in the morning.  Note that this
  3932.        trick is no longer necessary, providing you run RReemmiinndd  in
  3933.        daemon mode.
  3934.  
  3935.             remind -c12 /dev/null Jan 1993
  3936.  
  3937.        This  invocation of RReemmiinndd will cause it to print a calen-
  3938.        dar for 1993, with all entries left blank.
  3939.  
  3940.             REM CAL [trigdate()-date(year(trigdate()), 1, 1)+1]
  3941.  
  3942.        This example puts an entry in each box of a calendar show-
  3943.        ing the number (1-365 or 366) of the day of the year.
  3944.  
  3945.             REM Tue 2 Nov SATISFY (year(trigdate())%4) == 0
  3946.             IF trigvalid()
  3947.                  REM [trigger(trigdate())] ++5 MSG \
  3948.                  U.S. Presidential Election!!
  3949.             ENDIF
  3950.  
  3951.        This example warns you 5 days ahead of each American pres-
  3952.        idential election.  The first RREEMM command  calculates  the
  3953.        first  Tuesday  after the first Monday in November.  (This
  3954.        is  equivalent  to  the  first  Tuesday  on  or  after   2
  3955.  
  3956.  
  3957.  
  3958.                          13 October 1993                       60
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964. REMIND(1)                                               REMIND(1)
  3965.  
  3966.  
  3967.        November.)   The  SSAATTIISSFFYY  clause ensures that the trigger
  3968.        date is issued only in election years, which are multiples
  3969.        of   4.   The  second  RREEMM  command  actually  issues  the
  3970.        reminder.
  3971.  
  3972.        DDEETTAAIILLSS AABBOOUUTT TTRRIIGGGGEERR CCOOMMPPUUTTAATTIIOONN
  3973.  
  3974.        Here is a _c_o_n_c_e_p_t_u_a_l description of how triggers are  cal-
  3975.        culated.  Note that RReemmiinndd actually uses a much more effi-
  3976.        cient procedure, but the results are the same  as  if  the
  3977.        conceptual procedure had been followed.
  3978.  
  3979.        RReemmiinndd starts from the current date (that is, the value of
  3980.        ttooddaayy(())) and scans forward, examining each day  one  at  a
  3981.        time until it finds a date which satisfies the trigger, or
  3982.        can prove that no such dates (on or  later  than  ttooddaayy(()))
  3983.        exist.
  3984.  
  3985.        If  RReemmiinndd is executing a SSAATTIISSFFYY-type reminder, it evalu-
  3986.        ates the expression with ttrriiggddaattee(()) set to the date  found
  3987.        above.   If  the  expression evaluates to zero or the null
  3988.        string, RReemmiinndd continues the scanning procedure  described
  3989.        above,  starting  with  the  day  after  the trigger found
  3990.        above.
  3991.  
  3992.        The SSCCAANNFFRROOMM clause (having a syntax similar to UUNNTTIILL) can
  3993.        modify  the  search  strategy  used.  In this case, RReemmiinndd
  3994.        begins the scanning procedure at _s_c_a_n___d_a_t_e, which  is  the
  3995.        date specified in the SSCCAANNFFRROOMM clause.  For example:
  3996.  
  3997.             REM Mon 1 SCANFROM 17 Jan 1992 MSG Foo
  3998.  
  3999.        The  example above will always have a trigger date of Mon-
  4000.        day, 3 February 1992.  That is because RReemmiinndd starts scan-
  4001.        ning  from  17 January 1992, and stops scanning as soon as
  4002.        it hits a date which satisfies "Mon 1."
  4003.  
  4004.        The main use of SSCCAANNFFRROOMM is in situations where  you  want
  4005.        to calculate the positions of floating holidays.  Consider
  4006.        the Labour Day example shown much earlier.  Labour Day  is
  4007.        the  first  Monday in September.  It can move over a range
  4008.        of 7 days.  Consider the following sequence:
  4009.  
  4010.             REM Mon 1 Sept SCANFROM [trigger(today()-7)] SATISFY 1
  4011.             OMIT [trigger(trigdate())]
  4012.  
  4013.             REM Mon AFTER MSG Hello
  4014.  
  4015.        The SSCCAANNFFRROOMM clause makes sure that RReemmiinndd begins scanning
  4016.        from  7  days  before the current date.  This ensures that
  4017.        Labour Day for the current year will continue to be  trig-
  4018.        gered until 7 days after it has occurred.  This allows you
  4019.        to safely use the AFTER keyword as shown.
  4020.  
  4021.  
  4022.  
  4023.  
  4024.                          13 October 1993                       61
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030. REMIND(1)                                               REMIND(1)
  4031.  
  4032.  
  4033.        In general, use SSCCAANNFFRROOMM as shown for safe movable  OOMMIITTss.
  4034.        The  amount you should scan back by (7 days in the example
  4035.        above) depends on the number of possible consecutive OOMMIITT--
  4036.        tteedd  days which may occur, and on the range of the movable
  4037.        holiday.  Generally, a value of 7 is safe.
  4038.  
  4039.        Note that if you use one RREEMM command to calculate a  trig-
  4040.        ger  date, perform date calculations (addition or subtrac-
  4041.        tion, for example) and then use the  modified  date  in  a
  4042.        subsequent  RREEMM  command,  the results _m_a_y _n_o_t _b_e _w_h_a_t _y_o_u
  4043.        _i_n_t_e_n_d_e_d_.  This is because you have circumvented the  nor-
  4044.        mal  scanning mechanism.  You should try to write RREEMM com-
  4045.        mands which compute trigger dates that can be used unmodi-
  4046.        fied  in  subsequent  RREEMM  commands.   The file "defs.rem"
  4047.        which comes with the RReemmiinndd  distribution  contains  exam-
  4048.        ples.
  4049.  
  4050.        DDEETTAAIILLSS AABBOOUUTT TTRRIIGGVVAALLIIDD(())
  4051.  
  4052.        The  ttrriiggvvaalliidd(()) function returns 1 if RReemmiinndd could find a
  4053.        trigger date for the previous RREEMM or IIFFTTRRIIGG command.  More
  4054.        specifically,  it  returns  1  if  RReemmiinndd finds a date _n_o_t
  4055.        _b_e_f_o_r_e _t_h_e _s_t_a_r_t_i_n_g _d_a_t_e _o_f _t_h_e _s_c_a_n_n_i_n_g  which  satisfies
  4056.        the  trigger.   In  addition, there is one special case in
  4057.        which ttrriiggvvaalliidd(()) returns 1 and ttrriiggddaattee(()) returns a mean-
  4058.        ingful result:
  4059.  
  4060.        If  the  RREEMM  or  IIFFTTRRIIGG  command did not contain an UUNNTTIILL
  4061.        clause, and contained all of the _d_a_y, _m_o_n_t_h and _y_e_a_r  com-
  4062.        ponents,  then  RReemmiinndd  will  correctly  compute a trigger
  4063.        date, even if it happens to be before the start  of  scan-
  4064.        ning.   Note  that this behaviour is not true for versions
  4065.        of RReemmiinndd prior to 03.00.01.
  4066.  
  4067. AAUUTTHHOORR
  4068.        David F. Skoll wrote RReemmiinndd.  The  moon  code  was  copied
  4069.        largely  unmodified  from  "moontool" by John Walker.  The
  4070.        Hebrew calendar support was taken  from  "hdate"  by  Amos
  4071.        Shapir.   The  authors of the language files are listed in
  4072.        the header file "lang.h" which comes  with  RReemmiinndd.   OS/2
  4073.        support  was  provided initially by Darrel Hankerson; more
  4074.        complete OS/2 support was done by Russ Herman.
  4075.  
  4076. BBUUGGSS
  4077.        There's no good reason why read-only system variables  are
  4078.        not  implemented  as functions, or why functions like vveerr--
  4079.        ssiioonn(()), etc.  are  not  implemented  as  read-only  system
  4080.        variables.
  4081.  
  4082.        Hebrew dates change at midnight, not sunset.
  4083.  
  4084.        The UTC functions are not reliable under MS-DOS.
  4085.  
  4086.        The  MS-DOS  version of RReemmiinndd does not support queuing or
  4087.  
  4088.  
  4089.  
  4090.                          13 October 1993                       62
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096. REMIND(1)                                               REMIND(1)
  4097.  
  4098.  
  4099.        timed activation of reminders.
  4100.  
  4101.        RReemmiinndd has some built-in limits on total line length, sub-
  4102.        stitution buffer length, number of global OOMMIITTs, etc.
  4103.  
  4104.  
  4105. SSEEEE AALLSSOO
  4106.        rem, elm, kall, rem2ps
  4107.  
  4108.  
  4109.  
  4110.  
  4111.  
  4112.  
  4113.  
  4114.  
  4115.  
  4116.  
  4117.  
  4118.  
  4119.  
  4120.  
  4121.  
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.  
  4129.  
  4130.  
  4131.  
  4132.  
  4133.  
  4134.  
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.  
  4151.  
  4152.  
  4153.  
  4154.  
  4155.  
  4156.                          13 October 1993                       63
  4157.  
  4158.  
  4159.