REMIND(1)

๐ŸŒธ REMIND ๐ŸŒธ

okay bestie, welcome to REMIND(1) โ€” that's the manual page for Remind, and the version we're vibing with here is 06.03.03. It's a sophisticated reminder service and honestly? she's iconic. ๐Ÿ’…


โœจ NAME โœจ

remind โ€” a sophisticated reminder service ๐ŸŽ€


๐Ÿ“– THE BOOK OF REMIND ๐Ÿ“–

so this man page is genuinely a good reference for Remind, no cap. BUT โ€” if you're a novice who's just trying to learn Remind? bestie, go download "The Book of Remind" from the Remind home page at this URL instead, it's the move:

https://dianne.skoll.ca/projects/remind/

๐ŸŒˆ SYNOPSIS ๐ŸŒˆ

remind [options] filename [date] [*rep] [time]

rem [options] [date] [*rep] [time]

๐Ÿ’– DESCRIPTION ๐Ÿ’–

Remind reads the filename you hand it and executes the commands it finds inside. Those commands are what issue reminders and alarms. And each reminder or alarm can be either a message sent to standard output, or a program to be executed. that's it, that's the whole vibe.

rem is a symbolic link to remind. so if Remind gets invoked as rem, you should not supply filename on the command line. instead, the file gets figured out like this:

  1. If the --file=filename option is given, then filename is used.
  2. If the environment variable REMIND_FILE is set, then its value is used.
  3. If the environment variable DOTREMINDERS is set, then its value is used. (this env var gets checked for historical reasons and to maintain backward-compatibility, iykyk)
  4. Otherwise, a default value of $HOME/.reminders is used.

If filename is specified as a single dash '-', then Remind takes its input from standard input. and in that case, if Remind has been compiled against the GNU Readline library, it'll use Readline to give you an interactive line-editing interface. cute, right? โœจ

If filename happens to be a directory rather than a plain file, then Remind reads all of the files (but not any subdirectories!) in that directory that match the pattern "*.rem". The files are read in sorted order; the sort order may depend on your locale, but it should match the sort order used by the shell to expand "*.rem".

Remind reads its files starting from the beginning to the end, or until it encounters a line whose sole content is __EOF__ (without the quotes). Anything after the __EOF__ marker is completely ignored. ๐Ÿ’€


๐Ÿฆ‹ MODES OF OPERATION ๐Ÿฆ‹

Remind has four major modes of operation:

๐Ÿ’œ Agenda Mode

Agenda Mode is the default mode. In this mode, Remind prints today's reminders on standard output and exits. It may fork a background process to pop up queued reminders for later in the day. main character energy fr fr.

๐Ÿ’œ Calendar Mode

In this mode, Remind generates a calendar either by drawing it in the terminal or by sending data in computer-readable format to a back-end program that actually draws the calendar.

๐Ÿ’œ Daemon Mode

This is a special mode of operation in which Remind is invoked by a front-end and runs as a daemon, accepting requests from the front-end and sending messages back to the front-end. TkRemind uses Remind in daemon mode.

๐Ÿ’œ Purge Mode

In this mode, Remind produces no output, but creates new versions of its input files with all expired reminders commented out.


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

Remind has a slew of options. If you're new to the program, ignore them for now and skip to the section "REMINDER FILES". no seriously, bestie, you don't need all of this yet.

  • -n โ€” The -n option causes Remind to print the next occurrence of each reminder in a simple calendar format. You can sort this by date by piping the output through sort(1). Note that the -n option causes any -g option to be ignored and also implicitly enables the -o option.
  • -j[n] โ€” Runs Remind in "purge" mode to get rid of expired reminders. See the section PURGE MODE for details.
  • -r โ€” The -r option disables RUN directives and the shell() function.
  • -c[flags]n โ€” The -c option causes Remind to produce a calendar that is sent to standard output. If you supply a number n, then a calendar will be generated for n months, starting with the current month. By default, a calendar for only the current month is produced. This option implicitly enables the -o option.

You can precede n (if any) with a set of flags. The flags are as follows:

  • '+' โ€” causes a calendar for n weeks to be produced.
  • 'a' โ€” causes Remind to display reminders on the calendar on the day they actually occur as well as on any preceding days specified by the reminder's delta. This also causes Remind to include text outside %"..."% sequences that would otherwise be removed (though the actual %" markers themselves are removed.)
  • 'l' โ€” causes Remind to use VT100 line-drawing characters to draw the calendar. The characters are hard-coded and will only work on terminals that emulate the VT00 line-drawing character set.
  • 'u' โ€” is similar to 'l', but causes Remind to use UNICODE line-drawing characters to draw the calendar. The characters are hard-coded and will only work on terminals that are set to UTF-8 character encoding. This flag also enables the use of the UNICODE "left-to-right" mark that can fix up formatting problems with right-to-left languages in the calendar display.
  • 'z' โ€” has the effect of setting the system variable $TerminalHyperlinks to 1. See the documentation of this variable in the section "SYSTEM VARIABLES"
  • 'c' โ€” causes Remind to use VT100 escape sequences to approximate SPECIAL COLOR reminders. Note that this flag is kept for backwards-compatibility; you should use the -@[n][,m][,b] command-line option instead.

In a UTF-8 locale, Remind will use "left-to-right marks" when creating a calendar with the -c option. Some terminals don't handle this correctly and garble the rendering of the calendar; see the documentation of $SuppressLRM in the section "SYSTEM VARIABLES" for a workaround. ๐Ÿ˜ญ

  • -@[n][,m][,b] โ€” Tells Remind to approximate SPECIAL COLOR and SHADE reminders using VT100 escape sequences. The approximation is (of necessity) very coarse, because the VT100 only has eight different color sequences, each with one of two brightnesses. A color component greater than 64 is considered "on", and if any of the three color components is greater than 128, the color is considered "bright".

If you supply the optional numeric parameters, they have the following meanings: n=0 tells Remind to use the standard 16 VT100 colors. n=1 tells it to use an extended 256-color palette supported by many terminal emulators such as xterm. And n=2 tells it to use escape sequences that support true 24-bit colors, again supported by many terminal emulators such as xterm.

If the optional m parameter is supplied following a comma, then m=0 tells Remind that the terminal background is dark, and Remind will brighten up dark colors to make them visible. If m=1, then Remind assumes the terminal background is light and it will darken bright colors to make them visible. If m is specified as 2, then Remind does not perform any adjustments, and some reminders may be hard or impossible to see if the color is too close to the terminal background color. If you supply the letter t rather than a number, then Remind attempts to guess the background color of the terminal, even if stdout is not a terminal.

On startup, if the standard output is a terminal, Remind attempts to determine if the terminal background is dark or light by sending a special escape sequence to determine the background color. The m parameter can override this check (or force it if m is given as t.)

If the optional b parameter is supplied following a comma, then b=0 tells Remind to ignore SPECIAL SHADE reminders (the default) and b=1 tells Remind to respect SPECIAL SHADE reminders by emitting VT100 escape codes to color the background of the calendar cell. Note that SHADE does not work well unless you are using the extended 256-color palette (n=1) or the true 24-bit colors (n=2). Note that for calendar cells that are shaded, the clamping mechanism described earlier for m=0 or m=1 is skipped; it is assumed that if you set both the foreground color of a reminder and the background color of a cell, then you know what you are doing. ๐Ÿ’…

  • -wcol[,pad[,spc[,spc2]]]] โ€” The -w option specifies the output width, padding and spacing of the formatted calendar output. col specifies the number of columns in the output device. If col is not specified, or is specified as 0, it defaults to the larger of 71 or the actual width of your terminal, or to 80 if standard output is not a terminal. If col is specified as the letter t, then Remind attempts to get the width of the /dev/tty terminal device. This is useful, for example, if you pipe calendar output into less; even though standard output is a pipe, you want the calendar to be sized correctly for your terminal window:
remind -c -wt .reminders | less

Note that the value of col is also used to set the system variable $FormWidth, which is initialized to col - 8. See "SYSTEM VARIABLES" for details.

pad specifies how many lines to use to "pad" empty calendar boxes. This defaults to 5. If you have many reminders on certain days that make your calendar too large to fit on a page, you can try reducing pad to make the empty boxes smaller. spc specifies how many blank lines to leave between the day number and the first reminder entry. It defaults to 1. spc2 may be 0 or 1 and it specifies whether or not blank lines should be printed in between reminders on the same day. The default is 1, which causes the blank lines to be printed.

Any of col, pad or spc can be omitted, providing you provide the correct number of commas. Don't use any spaces in the option.

  • -s[a]n โ€” The -s option is very similar to the -c option, except that the output calendar is not formatted. It is listed in a "simple format" that can be used as input for more sophisticated calendar-drawing programs. If n starts with "+", then it is interpreted as a number of weeks. This option also implicitly enables the -o option.

Oh and one more thing about that -s, because she's got range: if you immediately follow the s with the letter a, then Remind displays reminders on the calendar on the day they actually occur as well as on any preceding days specified by the reminder's delta. Bestie said "show me the truth AND the buildup" and honestly? iconic. โœจ

  • -p[a][p][p][q][+]n โ€” this one is like -s's cooler older sibling ๐Ÿซถ same energy, but the output carries extra info for a back-end, like the Rem2PS program that makes a PostScript calendar, plus various other back-end programs. If n starts with "+", then it means a number of weeks instead of a number of months, and back-ends are expected to produce weekly calendars. Heads up though: not all back-ends support weekly calendars; currently, only rem2pdf and rem2html do. And specifying a weekly calendar implicitly enables the pure JSON interchange format, similar to -ppp. ๐Ÿ’…

The format of the -p output is described in the rem2ps(1) man page. If you immediately follow the p with the letter a, then Remind displays reminders on the calendar on the day they actually occur as well as on any preceding days specified by the reminder's delta. If you follow the p with another p, then Remind uses a more comprehensive JSON-based format rather than the "simple calendar" format โ€” and that format is also documented in the rem2ps(1) man page. Finally, if you use three p's, as in -ppp, then Remind uses a pure JSON format, again documented in rem2ps(1). If you include a q letter with this option, then the usual calendar-mode substitution filter is disabled and the %"..."% sequences are preserved in the output. ๐ŸŽ€

Not me needing to spell this out: to pass INFO strings to a back-end, you must use -pp or -ppp. The simpler -p format is not capable of transmitting the INFO strings to the back-end. Fr fr.

The -p, -pp and -ppp options implicitly enable the -o option.

And note that the -pp or -ppp options also enable the -l option. ๐Ÿฆ‹

  • -l โ€” pair this with the -p option and Remind outputs additional information for back-end programs such as rem2ps. What does that extra info do? It lets the back-end programs correlate a reminder with the source file and line number that produced it. Detective mode: enabled. ๐Ÿ”
  • -m โ€” makes the -c or -p options produce a calendar whose first column is Monday rather than Sunday. (This conforms to the international standard.) Very "we start the week when the week actually starts" of you. ๐Ÿ’…
  • -v โ€” makes the output of Remind slightly more verbose. Currently, this causes Remind to echo a bad line in case of an error, and to print a security message if a script tests the $RunOff system variable. She's chatty, she's nosy, she's keeping receipts. ๐Ÿ“
  • -o โ€” causes Remind to ignore all ONCE directives. And bestie, ONCE is also ignored if any of the -c, -n, -p, or -s options is used, if a repetition factor *n is used, or if a date other than today's date is specified on the command-line. So many ways to make ONCE simply not show up. ๐Ÿ˜ญ
  • -t โ€” causes Remind to trigger all non-expired reminders, regardless of the delta supplied for each reminder. No chill, no delay, no filter. ๐Ÿ”ฅ
  • -tn โ€” if you supply a number n after the -t option, then Remind pretends that every REM command has a delta of ++n, regardless of any existing delta. Gaslighting the parser, respectfully. ๐Ÿ’€
  • -tz โ€” if you supply the letter z after the -t option, then Remind sets all REM statements' deltas to zero, regardless of the value supplied in the REM statement itself. In effect, this disables all deltas of the form +n and ++n. Delulu? No. Zero-lu. โœจ
  • -tt[n] โ€” causes Remind to assume a default delta of n minutes for all timed reminders. If -tt is given with no n, a default delta of 5 minutes is used. ๐Ÿ•”
  • -h โ€” the -h option ("hush...") suppresses certain warning and information messages. In particular, if no reminders are triggered, this mode produces no output. She's giving peace and quiet, main character silence. ๐Ÿคซ
  • -a โ€” causes Remind not to immediately trigger timed reminders that trigger on the current day. It also causes Remind not to place timed reminders in a calendar. If you supply two or more -a options, then Remind will trigger timed reminders that are in the future, but will not trigger timed reminders whose time has passed. (Regardless of how many -a options you supply, Remind will not include timed reminders in the calendar if at least one -a option is used.) Two a's = a whole different vibe, no cap. ๐Ÿ‘‘
  • -q โ€” causes Remind not to queue timed reminders for later execution. Sorry babe, no queue for you. ๐Ÿšซ
  • -f โ€” causes Remind to remain in the foreground when processing queued reminders, rather than forking off a background process to handle them. She stays. Periodt. ๐Ÿ’…
  • -e โ€” diverts error messages (normally sent to the standard error stream) to the standard output stream. Rerouting the drama to a different channel. ๐ŸŒ€
  • -dchars โ€” the -d option enables certain debugging modes, and chars specifies which modes to enable. Buckle up, here's the whole menu:
    • e โ€” Echo all input lines
    • x โ€” Trace all expression evaluation
    • t โ€” Display all trigger date computation
    • v โ€” Dump the variable table after execution of the reminder script
    • l โ€” Echo lines when displaying error messages
    • f โ€” Trace the reading of reminder files
    • p โ€” Issue warnings if a POP-OMIT-CONTEXT, POP-VARS or POP-FUNCS matches a corresponding PUSH that is in a different file.
    • s โ€” Trace expression parsing and display the internal expression node tree. This is unlikely to be useful unless you are working on Remind's expression evaluation engine. (iykyk ๐Ÿงš)
    • h โ€” Dump hash-table statistics on exit.
    • u โ€” When Remind exits, print a list of variables that were SET, but not subsequently used.
Note that the u debugging flag may produce spurious warnings. For example, this sequence of commands:
DEBUG +u
SET a 1
IFTRIG Wed
        MSG a = [a]
ENDIF
will issue a warning about a being unused unless it is run on a Wednesday. ๐Ÿ’€
  • n โ€” Print debugging information about why Remind considers an expression to be "non-constant"
  • q โ€” Output a TRANSLATE command each time the _() built-in function is called or the %(...) substitution sequence is encountered.
  • m โ€” Debug any problems with FMT-style markup. See the section "FORMATTED REMINDERS" for more information. ๐ŸŒธ
  • -g[a|d[a|d[a|d[a|d]]]] โ€” normally, reminders are issued in the order in which they are encountered in the reminder script. The -g option causes Remind to sort reminders by date and time prior to issuing them. The optional a and d characters specify the sort order (ascending or descending) for the date, time and priority fields. See the section "SORTING REMINDERS" for more information. Organized queen behaviour. ๐Ÿ‘‘
Note that -g is ignored if you use the -n option. ๐Ÿ™ˆ
  • -b[n] โ€” Set the time format for the calendar and simple-calendar outputs. N can range from 0 to 2, with the default 0. A value of 0 causes times to be inserted in 12-hour (am/pm) format. 1 causes times to be inserted in 24-hour format, and 2 inhibits the automatic insertion of times in the calendar output. Pick your clock aesthetic. โฐ
  • -x[n] โ€” Sets the iteration limit for the SATISFY clause of a REM command. Defaults to 10000. Bestie, we are not looping forever, we have boundaries. ๐Ÿ›‘
  • -kcmd โ€” instead of simply printing MSG-type reminders, this causes them to be passed to the specific cmd. You must use '%s' where you want the body to appear, and may need to enclose this option in quotes. Note that all shell characters in the body of the reminder are escaped with a backslash, and the entire body of the reminder is passed as a single argument. Note that this option overrides the -r option and the RUN OFF command.

As an example, suppose you have an X Window program called xmessage that pops up a window and displays its invocation arguments. You could use:

remind '-kxmessage %s &' ...

to have all of your MSG-type reminders processed using xmessage.

A word of warning: it is very easy to spawn dozens of xmessage processes with the above technique. So be very careful. Because all shell and whitespace characters are escaped, the program you execute with the -k option must be prepared to handle the entire message as a single argument. ๐Ÿ˜ญ

If you follow the -k option with a colon, then the command is applied only to queued timed reminders. Normal reminders are handled as usual. In the above example, if you want normal reminders to simply be displayed as usual, but queued reminders to be sent to notify-send, you could use:

remind '-k:notify-send %s &' ...

You use both -kcmd1 and -k:cmd2 to use different commands for queued versus non-queued reminders. Two commands, two lanes, both valid. ๐Ÿฆ‹

  • -z[n] โ€” Runs Remind in "daemon mode". If n is supplied, it specifies how often (in minutes) Remind should wake up to check if the reminder script has been changed. N defaults to 1, and can range from 1 to 60. Note that the use of the -z option also enables the -f option. She's awake, she's watching, she's checking in. ๐Ÿ‘€

If Remind is compiled on a system that supports inotify(7), then if the reminder script supplied on the command-line is actually a directory, Remind additionally checks if all files within that directory have been modified since startup.

If you supply the option -zj, Remind runs in a special mode called server mode. This is documented in the tkremind man page; see tkremind(1). The older server mode option -z0 still works, but is deprecated; it uses an ad-hoc method to communicate with the client rather than using JSON to communicate with the client. ๐Ÿ™ˆ


  • -uname โ€” runs Remind with the uid and gid of the user named name ๐Ÿ’…. It flips the uid and gid like described, and sets the environment variables HOME, SHELL and USER to that user's home directory, shell, and user name respectively. LOGNAME also gets set to the specified user name. This one's for shell scripts that mail reminders out to literally all the users, bestie. BUT โ€” as of Remind 3.00.17, using -u implies -r, so the RUN directive and shell() functions are disabled ๐Ÿšซ. However! If you prefix name with a + sign, then RUN and shell() stay enabled. So like: -uwhatever switches to user whatever and disables RUN, whereas -u+whatever switches to whatever but leaves RUN alive and thriving. โœจ

Non-root users can use -u too ๐Ÿซถ. But in that case it only changes the environment variables as described above โ€” it does not change the effective uid or gid. No cap.

  • -+username โ€” makes Remind trust files owned by the user username ๐Ÿ‘‘. Normally, if Remind reads a file you don't own, it disables RUN and the shell() function. This option makes it also trust files owned by username. You can stack multiple -+ options to trust multiple users, up to a limit of 20 trusted users.
  • -y โ€” makes Remind synthesize a tag for any reminder that's missing a TAG clause ๐Ÿท๏ธ.
  • -ivar=expr โ€” sets the value of var to expr, and preserves var ๐Ÿ’–. Expr can be any valid Remind expression. Peep the section "INITIALIZING VARIABLES ON THE COMMAND LINE" for more deets. If you skip the =expr part, then var gets initialized to 0. In other words, -ivar is exactly the same as -ivar=0. Periodt.
  • -ifunc(args)=definition โ€” lets you define a function right there on the command line ๐ŸŽ€.

If you supply a date on the command line, it has to be [day] month [year], where day is the day of the month, month is at least the first three letters of the English name of the month, and year is a year (all 4 digits) from 1990 to about 2075. You can leave out the day, which then defaults to 1. If you leave out the year, it defaults to the current year. You cannot leave out the month, bestie โ€” that's the one you gotta keep. ๐ŸŒธ

If you do supply a date on the command line, then Remind uses it, rather than the actual system date, as its notion of "today." ๐Ÿ˜Œ This lets you create calendars for future months, or test out how your reminders will be triggered in the future. Similarly, you can supply a time to set Remind's notion of "now" to a particular time. Supplying a time on the command line also implicitly enables the -q option and disables the -z option. The time may be specified in 24-hour format (e.g., 13:20) or the common "AM/PM" format (1:20pm). โฐ

If you'd rather specify the date more succinctly, you can supply it as YYYY-MM-DD or YYYY/MM/DD. You can even supply a date and time on the command line as one single argument: YYYY-MM-DD@HH:MM. iconic. ๐Ÿฆ‹

You can also specify the date as a trigger by prefixing it with the at symbol, @. You might need to quote the argument. In this case, Remind evaluates everything after the @ as a trigger and the resulting trigger date is used as the effective date. For example, if you wanna see what reminders will trigger on the next Friday the 13th, you could use this:

remind .reminders '@13 SATISFY [$Tw == 5]'

You can also specify the date directly and use an @ trigger argument; in this case, Remind uses the specified date as the starting point for the trigger calculation. As an example:

remind .reminders 2026-07-01 '@13 SATISFY [$Tw == 5]'

will set Remind's notion of "today" to 2026-11-13 because that is the first Friday the 13th on or after 2026-07-01. ๐Ÿคฏ

In addition, you can supply a repeat parameter, which has the form *rep. This causes Remind to be run rep times, with the date incrementing on each iteration. You may have to enclose the parameter in quotes to avoid shell expansion. See the subsection "Repeated Execution" in the section "CALENDAR MODE" for more info. ๐Ÿ”


โœจ LONG OPTIONS โœจ

Remind supports the following long options, which are case-sensitive:

  • --version โ€” causes Remind to print its version number to standard output and then exit. ๐Ÿ’…
  • --file=filename โ€” sets the name of the file to read using an option instead of relying on the positional parameter after all of the options. This simplifies writing Remind wrapper scripts since you can accept options after the option that sets the filename. If you do use the --file option, then you must not supply a filename as a positional parameter after all of the options. ๐Ÿ™ˆ
  • --hide-completed-todos โ€” in Calendar Mode, Remind normally shows all TODOs. If you supply this option, then it won't show TODOs that have been marked as completed. โœ…
  • --only-todos โ€” only issue TODO-type reminders. ๐Ÿ“
  • --only-events โ€” do not issue TODO-type reminders. ๐ŸŽˆ
  • --json โ€” in Agenda Mode, output JSON instead of the normal text-mode output. --json also disables sorting (the -g option) and disables queueing (the -q option). See the section "AGENDA MODE JSON OUTPUT" for more deets. The --json option is ignored in Calendar Mode. Note that in JSON mode, the output from any RUN-type reminder that would normally appear on standard output is redirected to standard error instead; this is so that RUN-type reminders don't mess up the output and cause invalid JSON to be produced on standard output. ๐Ÿ”ฅ
  • --no-fmt โ€” converts FMT-style reminders to ordinary MSG-type reminders by stripping out formatting tags. Use this flag for back-ends that cannot handle FMT-style reminders. See the section "FORMATTED REMINDERS" for more info. โœ‚๏ธ
  • --print-errs โ€” causes Remind to print all possible error messages to standard output and then exit. The messages are printed in a format suitable for the first argument of a TRANSLATE command. If you TRANSLATE the error messages, then Remind will use the translated versions when outputting error and warning messages. See also TRANSLATE GENERATE in the section "THE TRANSLATION TABLE". ๐ŸŒˆ
Heads up bestie: if an untranslated message contains printf-style formatting sequences like "%s" or "%d", then the translated message must contain the same sequences in the same order, or Remind will ignore it and use the original untranslated message. ๐Ÿ˜ญ
  • --print-config-cmd โ€” causes Remind to print the exact ./configure command that was used when Remind was built. You can use this to build a new version of Remind using the same configuration as an existing one by running:
eval `remind --print-config-cmd`

from the top-level Remind source directory. (However, it's safer to simply run remind --print-config-cmd and then type in the command once you've verified that it looks OK.) ๐Ÿซถ

  • --print-tokens โ€” causes Remind to print the tokens used by the parser, built-in function names, and system variable names to standard output and then exit. This output is designed to make it easy to create a syntax-highlighting file for various text editors. The output can be modified by hand or by a script into a syntax-highlighting file with relative ease. ๐ŸŽจ
  • --max-execution-time=n โ€” limits the total execution time (as measured by the wall clock) to n seconds. Super useful if Remind is invoked on potentially-untrustworthy files that could attempt to use a lot of resources. Note that the limit n is approximate and Remind might execute for one or two more seconds before it is killed. If n is specified as zero, then no limit is applied, just as if the option had not been used at all. โณ

If a limit is applied, it applies only to the foreground run of Remind. If Remind finishes processing the script and then starts handling queued reminders, the time limit is reset to no limit.

  • --max-expr-complexity=n โ€” limits the total complexity of expression valuation for a given line in a script to n nodes. Roughly speaking, each function call, operator, constant, variable reference, etc corresponds to one expression node. By default, the limit is set to 10000000 (ten million). You can explicitly set it to zero if you don't want any limit to apply. The default limit of ten million should never be triggered by any sensible Remind script, however, and we don't recommend changing the limit. ๐Ÿง 
  • --test โ€” the --test long option is only for use by the acceptance tests run by make test. Do not use this option in production. ๐Ÿ’€
  • --flush โ€” makes Remind's standard output and standard error streams unbuffered. It is mostly used for testing and should probably not be used in production. ๐Ÿšฝ

๐Ÿ“– REMINDER FILES ๐Ÿ“–

Remind uses scripts to control its operation. You can use any text editor capable of creating plain-text files to create a Remind script. The commands inside a script can range from the very simple and almost immediately understandable:

REM Mar 31 MSG International Transgender Day of Visibility

to the baroque and obscure:

REM [date(thisyear, 1, 1) + 180] ++5 OMIT \
sat sun BEFORE MSG [ord(thisyear-1980)] payment due %b!

A reminder file consists of commands, with one command per line. Several lines can be continued using the backslash character, as in the above example. In this case, all of the concatenated lines are treated as a single line by Remind. Note that if an error occurs, Remind reports the line number of the last line of a continued line. ๐Ÿ˜ค

Remind ignores blank lines, and lines beginning with the '#' or ';' characters. You can use the semicolon as a comment character if you wish to pass a Remind script through the C pre-processor, which interprets the '#' character as the start of a pre-processing directive. ๐Ÿ’ฌ

Note that Remind processes line continuations before anything else. For example:

# This is a comment \
This line is part of the comment because of line continuation \
and so on.
REM MSG This line is not ignored (no \ above)

Remind is not case sensitive; you can generally use any mixture of upper- or lower-case for commands, parameters, invocation options, etc. ๐ŸŽ‰

๐Ÿ’– THE REM COMMAND ๐Ÿ’–

Okay bestie, this is THE moment. The REM command is the single most powerful thing in a Remind script โ€” it's the one that actually issues reminders. Main character energy, no cap. Its syntax is:

REM [ONCE] [date_spec] [back] [delta] [repeat] [TODO] [MAX-
OVERDUE n] [COMPLETE-THROUGH complete_date] [PRIORITY prio] [SKIP
| BEFORE | AFTER] [OMIT omit_list] [ADDOMIT] [NOQUEUE] [OMITFUNC
omit_function] [AT time [tdelta] [trepeat]] [SCHED
sched_function] [WARN warn_function] [UNTIL expiry_date | THROUGH
last_date] [SCANFROM scan_date | FROM start_date] [DURATION
duration] [TAG tag] [TZ timezone] [INFO "info_string"] MSG | MSF
| FMT | RUN | CAL | SATISFY | SPECIAL special | PS | PSFILE body

You can put the parts of a REM command in any order you want โ€” truly choose-your-own-adventure โ€” except that the body has to come immediately after the MSG, RUN, CAL, PS, PSFILE or SATISFY keyword. That part is non-negotiable, bestie. And the chunk of the REM command that comes before the MSG, MSF, RUN, CAL or SATISFY clause? That's called a trigger. ๐Ÿ’…

Heads up, and it's a real one: in earlier versions of Remind, the REM token was optional, as long as the rest of the command couldn't be confused with another Remind command. That's deprecated now, and it'll throw a warning at you. Write all your reminder lines starting with the REM command, periodt.

โœจ MSG, MSF, RUN, CAL, SPECIAL, PS and PSFILE โœจ

These keywords say what type of reminder you've got. (SATISFY is a whole extra saga and gets explained later, don't worry about it yet.)

A MSG-type reminder normally prints a message to standard output, after it's run through a special substitution filter โ€” that's the whole "THE SUBSTITUTION FILTER" section, we'll get there. But if you used the -k command-line option, then MSG-type reminders get handed off to the appropriate program instead. Important: the options -c, -s, -p and -n all disable the -k option.

Older Remind versions let you skip the reminder type entirely, and it just defaulted to MSG. That's deprecated too and it'll warn at you. Something like:

REM 6 January Dianne's Birthday

will issue the warning "Missing REM type; assuming MSG".

The MSF keyword is basically MSG's sibling, except the reminder gets formatted to fit into a paragraph-like format. Three system variables are running the show here: $FirstIndent, $SubsIndent and $FormWidth โ€” full gossip on those in the "SYSTEM VARIABLES" section. MSF also messes with your spacing: extra spaces get discarded, and two spaces get placed after periods and other characters, exactly as specified by $EndSent and $EndSentIg. ๐ŸŽ€ And note โ€” if the body of the reminder has newline characters in it (put there with the %_ sequence), those newlines count as the beginnings of new paragraphs, and the $FirstIndent indentation is used for the next line. You can use two consecutive newlines to get spaced paragraphs out of a single reminder body. Cute, right?

A RUN-type reminder also runs the body through the substitution filter, but then it executes the result as a system command. ๐Ÿ˜ณ

A CAL-type reminder only exists to place entries in the calendar you get when Remind is run with -c, -s or -p.

And when Remind runs a command, it sets the command's standard input to come from /dev/null. Yes, exactly that.

A PS or PSFILE-type reminder passes PostScript code directly to the printer when you're producing PostScript calendars. You can use it to shade calendar entries (peep the psshade() function), drop graphics into the calendar, or pretty much anything else you dream up. Real talk though: you should not use these types of reminders unless you are an expert PostScript programmer. Also โ€” PS and PSFILE reminders are ignored unless Remind is run with the -p option. More deets in "More about PostScript".

A SPECIAL-type reminder passes "out-of-band" info from Remind to a calendar-producing back-end. It should be followed by a word saying what type of special data is being passed. What the special type means depends on the back-end. For the Rem2PS back-end, SPECIAL PostScript is equivalent to a PS-type reminder, and SPECIAL PSFile is equivalent to a PSFILE-type reminder. The body of a SPECIAL reminder obviously depends on the back-end too โ€” and a back-end must ignore any SPECIAL it doesn't recognize.


๐ŸŒธ DATE SPECIFICATIONS ๐ŸŒธ

A date_spec is made of zero to four parts: day (day of month), month (month name), year, and weekday. Month and weekday are the English names of months and weekdays, and you need at least the first three characters. Here's the vibe of each part:

  • day: 1, 22, 31, 14, 3
  • month: JANUARY, feb, March, ApR, may, Aug
  • year: 1990, 1993, 2030. The year can range from 1990 to 2075.
  • weekday: Monday, tue, Wed, THU, Friday, saturday, sundAy

And fyi โ€” you can have several weekday components separated by spaces in a date_spec. ๐Ÿ‘‘

๐Ÿ’ซ INTERPRETATION OF DATE SPECIFICATIONS ๐Ÿ’ซ

Here's how date specs actually get read, one flavour at a time:

  1. Null date specification โ€” the reminder triggers every day. The trigger date for a specific run is just the current system date. Like:
REM MSG This is triggered every time Remind runs
  1. Only day present. Triggers on the specified day of each month. The trigger date for a particular run is the closest such day to the current system date. Like:
REM 1 MSG First of every month.
REM 31 MSG 31st of every month that has 31 days.
  1. Only month present. Triggers every day of the specified month. Like:
REM Feb MSG Every day in February
  1. day and month present. Like:
REM 6 Jan MSG Every 6th of January
REM Feb 29 MSG Every 29th of February
  1. Only year present. Like:
REM 1991 MSG Every day in 1991
  1. year and day present. Like:
REM 1 1990 MSG 1st of every month in 1990
REM 1992 23 MSG 23rd of every month in 1992
  1. year and month present. Like:
REM Feb 1991 MSG Every day in Feb 1991
REM 1992 September MSG Every day in Sept 1992
  1. year, month and day present. Like:
REM 8 Jan 1991 MSG 8th January 1991.
REM 1992 March 9 MSG 9th March 1992.
  1. weekday only. Like:
REM Sat MSG Every Saturday
REM Mon Tue Wed Thu Fri MSG Every working day
REM Monday Wednesday MSG Every Monday and Wednesday
  1. weekday and day present. Like:
REM Sat 1 MSG First Saturday of every month
REM Mon Tue Wed Thu Fri 15 \
     MSG 1st working day on or after 15th of every month
  1. weekday and month present. Like:
REM Mon March MSG Every Monday in March
REM Mon Tue Wed Thu Fri Feb MSG Every working day in February
  1. weekday, month and day present. Like:
REM Mon 1 March MSG First Monday in March
REM Sat Sun 15 July MSG First Sat or Sun on or after 15 July
  1. weekday and year present. Like:
REM Sat Sun 1991 MSG Every Saturday and Sunday in 1991
  1. weekday, day and year present. Like:
REM Mon 15 1990 MSG 1st Mon after 15th of every month in 1990
REM Mon Tue Wed Thu Fri 1 1990 \
     MSG 1st working day of every month in 1990
  1. weekday, month and year present. Like:
REM Mon Wed 1991 Feb MSG Every Mon and Wed in Feb 1991.
  1. weekday, day, month and year present. Like:
REM Mon Tue Wed Thu Fri 28 Oct 1990 \
     MSG 1st working day on or after 28 October 1990.

Now the important bit, bestie, don't skip this: when both weekday and day are specified, Remind picks the first date on or after the specified day that also satisfies the weekday constraint. It does this by picking the first date on or after the specified day that's listed in the list of weekdays. So a reminder like:

REM Mon Tue 28 Oct 1990 MSG Hi

would only be issued on Monday, 29 October, 1990. It would not be issued on Tuesday, 30 October, 1990, because the 29th is the first date to satisfy the weekday constraints. The way that it just... stops there. ๐Ÿ˜ญ


๐Ÿฆ‹ SHORT-HAND DATE SPECIFICATIONS ๐Ÿฆ‹

Besides spelling out day, month and year separately, you can also write YYYY-MM-DD or YYYY/MM/DD. For example, these two statements are equivalent:

REM 5 June 2010 MSG Cool!
REM 2010-06-05  MSG Cool!

You can also specify a date and time as YYYY-MM-DD@HH:MM. These are equivalent:

REM 19 Dec 2010 AT 16:45 MSG Hi
REM 2010-12-19@16:45 MSG Hi

But there's one subtlety with short-hand date specs, and it's a sneaky one. These two statements are not equivalent:

REM 19 Dec 2010 AT 16:45 +60 MSG Hi
REM 2010-12-19@16:45 +60 MSG Hi

In the second statement, the "+60" is a delta that applies to the date, not a tdelta that applies to the time. So our recommendation: explicitly use the AT keyword with timed reminders. Please. For me. ๐Ÿซถ


โญ THE REMIND ALGORITHM โญ

Remind uses this algorithm to compute a trigger date: starting from the current date, it examines each day, one at a time, until it finds a date that satisfies the date specification โ€” or proves to itself that no such date exists. (Okay, technically Remind just behaves as if it used this algorithm, because in practice it would be way too slow. Internally it uses much faster techniques to calculate a trigger date.) See DETAILS ABOUT TRIGGER COMPUTATION for more info.

๐ŸŒˆ BACKWARD SCANNING ๐ŸŒˆ

Sometimes you need to specify a date as being a set amount of time before another date. For example, the last Monday in a given month is computed as the first Monday in the next month, minus 7 days. That's what the back specification is for:

REM Mon 1 -7 MSG Last Monday of every month.

A back is written with one or two dashes followed by an integer. This makes Remind move "backwards" from what would normally be the trigger date. The difference between --7 and -7 gets explained when the OMIT keyword comes up. ๐Ÿ‘€

๐ŸŽ€ ADVANCE WARNING ๐ŸŽ€

Some reminders deserve a heads-up. Like, you probably want to know about someone's birthday a few days early โ€” that's just being a good friend. The delta portion of the REM command handles this. It's written as one or two "+" signs followed by a number n. Again, the difference between the "+" and "++" forms gets explained under the OMIT keyword. Remind will trigger the reminder on the computed trigger date, as well as on each of the n days before the event. Examples:

REM 6 Jan +5 MSG Remind me of birthday 5 days in advance.

That one above would be triggered every 6th of January, and the 1st through 5th of January. Obsessed with the foresight. โœจ


๐Ÿ’œ PERIODIC REMINDERS ๐Ÿ’œ

okay so bestie, we already covered some built-in ways to make certain periodic reminders happen. like, an event that happens every Wednesday? you can just write:

REM Wed MSG Event!

but here's the thing: events that don't repeat daily, weekly, monthly, or yearly need a different glow-up. that's where the repeat component of the REM command comes in, and it's literally iconic. to use it, you have to completely specify a date (year, month, and day, and optionally weekday); this is the start date of the repetition period. the repeat component is an asterisk followed by a number that says how many days the repetition period is.

for example, say you get paid every second Wednesday, and your last payday was Wednesday, 28 October, 1992. you can use:

REM 28 Oct 1992 *14 MSG Payday

this issues the reminder every 14 days, starting from 28 Oct 1992. you can use delta and back with repeat. but note, bestie: the back is used only to compute the starting date; after that, the reminder repeats with the specified period. similarly, if you specify a weekday, it's used only to calculate the starting date, and does not affect the repetition period. periodt. ๐Ÿ’…

โœจ SCANFROM and FROM โœจ

the SCANFROM and FROM keywords are for advanced Remind programmers only, and they'll be explained in the section "DETAILS ABOUT TRIGGER COMPUTATION" near the end of this manual. note that SCANFROM is available only in versions of Remind from 03.00.04 up. FROM is available only from 03.01.00 and later. so if you're on an older version, don't come for me. ๐Ÿ’…

๐Ÿ‘‘ PRIORITY ๐Ÿ‘‘

the PRIORITY keyword must be followed by a number from 0 to 9999. it's used in Calendar Mode and when sorting reminders. if two reminders have the same trigger date and time, then they are sorted by priority. if the PRIORITY keyword is not supplied, a default priority of 5000 is used. (this default can be changed by adjusting the system variable $DefaultPrio. see the section "SYSTEM VARIABLES" for more info.)

๐ŸŽ€ EXPIRY DATES ๐ŸŽ€

some reminders should be issued periodically for a certain time, but then expire. like, suppose you have a class every Friday, and your last class is on 11 December 1992. you can use:

REM Fri UNTIL 11 Dec 1992 MSG Class today.

another example: suppose you have jury duty from 30 November 1992 until 4 December 1992. the following reminder will issue the message every day of your jury duty, as well as 2 days ahead of time:

REM 1992-11-30 *1 +2 UNTIL 1992-12-04 MSG Jury duty

note that the repeat of *1 is necessary; without it, the reminder would be issued only on 30 November (and the two days preceding.)

as a special case, you can use the THROUGH keyword instead of *1 and UNTIL. the following two REM commands are equivalent:

REM 1992-11-30 *1 +2 UNTIL 1992-12-04 MSG Jury duty
REM 1992-11-30 +2 THROUGH 1992-12-04 MSG Jury duty

if you have an expiry date via the use of THROUGH or UNTIL, then Remind will never trigger the reminder after the expiry date. for example, if you have this:

OMIT 2021-01-08
REM 2021-01-01 THROUGH 2021-01-08 AFTER MSG Test

the reminder will not be triggered on 2021-01-08, and nor will it be triggered on 2021-01-09; even though the AFTER keyword would normally move the 8th's reminder to the 9th, the expiry date of 2021-01-08 overrides that. no cap.

๐Ÿ’€ THE ONCE KEYWORD ๐Ÿ’€

sometimes, it's necessary to ensure that reminders are run only once on a given day. for example, compare the following two reminders:

REM Fri RUN do_backup
REM Fri ONCE RUN do_backup

the first will be run every time you invoke Remind on a Friday, whereas the second will be run only the first time you invoke Remind on a given Friday.

if you run Remind from your .login script, for example, and log in several times per day, the do_backup program in the first reminder will be run each time you log in. if, however, you use the ONCE keyword in the reminder, the Remind checks the last access date of the reminder script. if it's the same as the current date, Remind assumes that it has already been run, and will not issue reminders containing the ONCE keyword.

note that if you view or edit your reminder script, the last access date will be updated, and the ONCE keyword will not operate properly. you can fix this by setting a timestamp file for Remind to track the last-run date; see the documentation of $OnceFile in the SYSTEM VARIABLES section. if you use standard input as your Remind input file, then you must use $OnceFile for the ONCE keyword to work properly.

if you start Remind with the -o option, then the ONCE keyword will be ignored and any $OnceFile will be ignored. so don't be surprised, bestie.

๐Ÿฆ‹ LOCALLY OMITTING WEEKDAYS ๐Ÿฆ‹

the OMIT portion of the REM command is used to "omit" certain days when counting the delta or back. it's specified using the keyword OMIT followed by a list of weekdays. its action is best illustrated with examples:

REM 1 +1 OMIT Sat Sun MSG Important Event

this reminder is normally triggered on the first of every month, as well as the day preceding it. however, if the first of the month falls on a Sunday or Monday, then the reminder is triggered starting from the previous Friday. this is because the delta of +1 does not count Saturday or Sunday when it counts backwards from the trigger date to determine how much advance warning to give.

contrast this with the use of ++1 in the above command. in this case, the reminder is triggered on the first of each month, as well as the day preceding it. the omitted days are counted.

REM 1 -1 OMIT Sat Sun MSG Last working day of month

again, in the above example, the back of -1 normally causes the trigger date to be the last day of the month. however, because of the OMIT clause, if the first of the month falls on a Sunday or Monday, the trigger date is moved backwards past the weekend to Friday. (if you have globally omitted holidays, the reminder will be moved back past them, also. see "The OMIT command" for more details.)

by comparison, if we had used --1, the reminder would be triggered on the last day of the month, regardless of the OMIT.

if you locally omit weekdays but also have globally-omitted weekdays, then the list of omitted weekdays is the union of the two. consider this example:

OMIT Sat Sun
REM 15 OMIT Fri Sat MSG Whatever

in the REM command, the effective list of omitted weekdays will be Friday, Saturday and Sunday. slay.

๐Ÿงš COMPUTED LOCAL OMITS ๐Ÿงš

the OMITFUNC phrase of the REM command allows you to supply a function that determines whether or not a date is omitted. note that OMITFUNC must be given just the name of a user-defined function; it can't take an arbitrary expression or the name of a built-in function. so don't try it.

the function is passed a single parameter of type DATE, and must return a non-zero integer if the date is considered "omitted" and 0 otherwise. here's an example:

FSET _third(x) (day(x) % 3) || \
               (wkdaynum(x) == 0) || \
               (wkdaynum(x) == 6)
REM OMITFUNC _third AFTER MSG Working day divisible by 3

in the example above, the reminder is triggered every Monday to Friday whose day-of-month number is divisible by three. here's how it works:

  • the OMITFUNC _third portion causes all days for which _third(x) returns non-zero to be considered "omitted". this causes all days whose day-of-month number is not a multiple of three to be omitted. note that _third also returns non-zero if the weekday is Sunday or Saturday.
  • the AFTER keyword causes the reminder to be moved after a block of omitted days.

the combination of OMITFUNC and AFTER keyword causes the reminder to be issued on all days whose day-of-month number is divisible by three, but not on Saturday or Sunday.

note that if you use OMITFUNC, then a local OMIT is ignored as are all global OMITs. if you want to omit specific weekdays, your omit function will need to test for them specifically. if you want to take into account the global OMIT context, then your omit function will need to test for that explicitly (using the isomitted() function.)

note that an incorrect OMITFUNC might cause all days to be considered omitted. for that reason, when Remind searches through omitted days, it terminates the search after the SATISFY iteration limit (command-line option -x.) so be careful, bestie.

๐Ÿ’– ADDING TRIGGER DATES TO THE OMIT CONTEXT ๐Ÿ’–

if the ADDOMIT keyword appears in a REM command, then the trigger date (if one could be calculated) is automatically added to the list of global OMITs.

the command:

REM ... whatever ... ADDOMIT MSG Foo

is identical in behavior to the sequence:

REM ... whatever ... SATISFY 1
IF trigvalid()
    OMIT [trigdate()] MSG Foo
ENDIF

๐ŸŒˆ TIMED REMINDERS ๐ŸŒˆ

timed reminders are those that have an AT keyword followed by a time and optional tdelta and trepeat. the time may be specified in 24-hour format, with 0:00 representing midnight, 12:00 representing noon, and 23:59 representing one minute to midnight. alternatively, it may be specified in common "AM/PM" format; in this case, the hour must range from 1 to 12. 12:00am represents midnight, 12:00pm represents noon, and 11:59pm represents one minute to midnight. the "am" and "pm" portions are case-insensitive and the "m" is optional.

you can use either a colon or a period to separate the hours from the minutes. that is, 13:39 and 13.39 are equivalent.

Remind treats timed reminders specially. if the trigger date for a timed reminder is the same as the current system date, the reminder is queued for later activation. when Remind has finished processing the reminder file, it puts itself in the background, and activates timed reminders when the system time reaches the specified time. note that if you use the NOQUEUE modifier in the REM command, then this queuing and background activation is not performed. NOQUEUE is useful if you want a time to be associated with a reminder (e.g., in the calendar) but are not interested in a popup reminder happening at the specified time.

if you use a very large tdelta, then Remind will queue future-dated reminders whose tdelta and optional trep would cause them to be issued today.

however, if you use the SCHED keyword, then any tdelta is ignored and you cannot force the reminder to be queued earlier than the actual trigger date.

for example, the following reminder, triggered every working day, will emit a message telling you to leave at 5:00pm:

REM Mon Tue Wed Thu Fri AT 17:00 MSG Time to leave!

the following reminder will be triggered on Thursdays and Fridays, but will only be queued on Fridays:

REM Fri ++1 AT 1:00PM MSG Lunch at 1pm Friday.

okay so tdelta and trepeat? bestie, they have the exact same form as a repeat and a delta โ€” literally the same shape โ€” except the units are minutes. ๐Ÿ’…

so this reminder:

REM AT 12:00 +45 MSG Example

gets triggered at 12:00pm and 45 minutes before it. two dings, one line. iconic.

and this one:

REM AT 12:00 +75 *30 MSG Example2

starts at 10:45, keeps going every half hour until 11:45, and then pops off again at noon. โœจ

+75 means the reminder gets issued starting 75 minutes before noon โ€” i.e. at 10:45. the *30 says it's subsequently issued every 30 minutes. and here's the lil detail that catches people out: the reminder is always issued at the specified time, even if the tdelta is not a multiple of the trepeat. so the example above fires at 10:45am, 11:15am, 11:45am, and 12:00pm. yes, noon gets its own moment even though 75 isn't a multiple of 30. that's the rule, not a glitch. ๐Ÿ™ˆ

also, in the time specification there is no distinction between the + and ++ forms of tdelta. same energy, different keystroke. periodt.


Normally, Remind issues timed reminders as it processes the reminder script, and it queues them for later too. don't want the "right now, mid-processing" version? that's the -a command-line option โ€” it tells Remind to only queue them for later. don't want them queued for later at all? that's -q. pick your fighter. ๐ŸฅŠ

Normally Remind forks a background process to handle queued reminders. want it to stay in the foreground instead? -f, bestie. super useful in things like .xinitrc scripts, where you can drop:

remind -fa myreminders &

which guarantees that when you exit X-Windows, the Remind process gets killed too. no lingering reminder ghosts in your session. ๐Ÿฆ‹


โš ๏ธ WARNING ABOUT TIMED REMINDERS โš ๏ธ

okay this part actually matters so don't skim it ๐Ÿ’€

Note: if you use user-defined functions or variables (they get explained later, dw) in the bodies of timed reminders, then when those timed reminders get activated, the variables and functions have the definitions that were in effect at the end of the reminder script. and those definitions may not necessarily be the ones that were in effect at the time the reminder was queued. ๐Ÿ˜ญ

on top of that, the OMIT context is whatever was in effect at the end of the reminder script โ€” which may not necessarily be the same as it was when the REM command was first processed.

so yeah. timed reminders remember the end of the script, not the moment you queued them. noted. ๐Ÿ“


๐Ÿ—“๏ธ THE SCHED AND WARN KEYWORDS ๐Ÿ—“๏ธ

The SCHED keyword gives you more precise control over the triggering of timed reminders, and the WARN keyword gives you precise control over the advance triggering of all types of reminders. ๐Ÿ”ฅ

but we gotta defer the discussion until after expressions and user-defined functions have been explained. patience, bestie. go look at the subsection "PRECISE SCHEDULING" further on.


๐Ÿท๏ธ TAG, INFO AND DURATION ๐Ÿท๏ธ

The TAG keyword lets you "tag" certain reminders. this facility is what certain back-ends or systems built around Remind use โ€” think TkRemind. those back-ends have their own specific rules about tags, so check their documentation for the deets. ๐Ÿ‘‘

TAG is followed by a tag consisting of up to 48 characters. you can have as many TAG clauses as you like in a given REM statement. a tag can contain any character except for whitespace and a comma.

if you supply the -y option to Remind, then any reminder that lacks a TAG gets one synthesized. the synthesized tag is the characters __syn__ followed by the hexadecimal representation of the MD5 sum of the REM command line. so every distinct REM command gets a more-or-less unique identifier. slay. ๐Ÿ’…

The INFO keyword is similar to TAG, but it's meant to convey metadata about an event โ€” like its location. back-ends have their own rules about which info_strings they recognize, and they must ignore any info_strings they don't recognize. also note that INFO must be followed by a quoted string; you can include newlines in the string by supplying them as "\n". ๐ŸŒธ

an INFO string must be of the form "Header: Value". the header can consist of any printable character, but cannot contain whitespace. the value can consist of any characters you like. space may not appear before the colon, but it can appear afterwards โ€” and that space is not considered part of the value. if there's more than one INFO string for a given reminder, there cannot be any duplicate headers. case is ignored when determining whether a header is a duplicate of an existing one. ๐Ÿ‘€

example time! a hypothetical back-end might let you set the location and description of a reminder like this:

REM 26 Feb 2025 INFO "Location: Boardroom #2" \
                INFO "Description: Go over latest pull requests" \
                MSG Engineering meeting

while back-ends can choose which INFO strings to support, all back-ends should endeavor to support three standard ones: Location:, Description: and Url:. TkRemind supports all three โ€” it turns reminders with a Url: INFO string into hyper-links, and pops up information windows for the Location: and Description: INFO strings. Location: and Url: are self-explanatory; Description: is meant for a longer, more in-depth description of the reminder than the summary that's normally displayed. ๐Ÿซถ

The DURATION keyword makes sense only for timed reminders โ€” it specifies the duration of an event. so if you've got a 90-minute meeting starting at 1:00pm, any of these work:

REM 5 March 2021 AT 13:00 DURATION 1:30 MSG Meeting
REM 5 March 2021 AT 13:00 DURATION 90 MSG Meeting
REM 5 March 2021 AT 1:00pm DURATION 1:30 MSG Meeting
REM 5 March 2021 AT 1:00pm DURATION 90 MSG Meeting

for long-duration reminders, it's convenient to use expressions to simplify writing the DURATION. like, if you're away from 20 Feb 2023 through 23 Feb 2023 (a total of 4 days) you could write:

REM 20 Feb AT 00:00 DURATION [4*24]:00 MSG away
REM 20 Feb AT 00:00 DURATION [4*24*60] MSG away

and note that duration is specified either as hours:minutes or just as minutes specified as an integer. ๐Ÿ•

if you specify a duration of 00:00 or 0, then Remind behaves exactly as if no DURATION at all had been present. and even though durations written as hours:minutes look superficially like a time-of-day, they are not โ€” the hours component is not limited to the range 00-23. go wild, honestly.


๐Ÿฌ SYNTACTIC SUGAR FOR REM ๐Ÿฌ

The REM command has syntactic sugar to let you express common reminders without writing the long form. the following pairs of reminders are equivalent:

REM First Monday April MSG Foo
REM Mon 1 April        MSG Foo

same reminder, two outfits. ๐Ÿ’…

REM Second Monday May  MSG Bar
REM Mon 8 May          MSG Bar
REM Third Monday MSG Third Monday of every month
REM Mon 15 MSG Third Monday of every month
REM Fourth Sunday June 2025 MSG Fourth Sunday in June 2025
REM Sun 22 June 2025 MSG Fourth Sunday in June 2025
REM Last Monday MSG Last Monday of every month
REM Mon 1 --7 MSG Last Monday of every month
REM Last Monday April MSG Last Monday of every April
REM Mon 1 May --7 MSG  Last Monday of every April
REM Last Monday December 2025 MSG Last Monday of Dec 2025
REM Monday 1 Jan 2026 --7 MSG Last Monday of Dec 2025

and note that Last effectively adjusts the month and year, if necessary, to make the reminder trigger on the correct date. sneaky but correct. ๐ŸŽ€

the keyword IN is completely ignored, so you can write stuff like:

REM Second Monday in May MSG foo
REM Last Monday in December 2025 MSG Bar

an alternate form of back makes writing reminders easier. the following groups of reminders are equivalent:

REM ~~1 MSG Last day of every month
REM Lastday MSG  Last day of every month
REM 1 --1 MSG Last day of every month
REM May ~~1 MSG Last day of May
REM Lastday May MSG Last day of May
REM 1 June --1 MSG Last day of May
REM Dec 2025 ~~1 MSG Last day of December 2025
REM Lastday Dec 2025 MSG Last day of December 2025
REM 1 Jan 2026 --1 MSG Last day of December 2025
REM Apr ~1 OMIT SAT SUN MSG Last workday of April
REM Lastworkday April OMIT SAT SUN MSG Last workday of April
REM 1 May -1 OMIT SAT SUN MSG Last workday of April
REM Apr ~~7 MSG Seventh-last day of April
REM 1 May --7 MSG Seventh-last day of April
REM Apr ~2 OMIT SAT SUN MSG Second-last workday of April
REM 1 May -2 OMIT SAT SUN MSG Second-last workday of April

as we see, Lastday is equivalent to ~~1 and Lastworkday is equivalent to ~1. ๐Ÿฆ‹

and now the fine print, because there's always fine print: note that the First/Second/Third/Fourth/Last keywords and the ~ and ~~ form of back imply a value for the day of the month; as such, they cannot be combined with a day. additionally, First/Second/Third/Fourth/Last must have at least one weekday name. the following are illegal:

REM First Monday 3 June MSG Huh?
REM April 3 ~~1 MSG What?
REM Second June MSG Where's the weekday???

so don't do that. ๐Ÿ™ˆ

โœจ THE SUBSTITUTION FILTER โœจ

okay bestie, listen up because this is the part where remind gets its glow up. ๐Ÿ’… Before anything gets processed, the body of a REM command gets run through a substitution filter. This little icon scans for sequences like %x (where x is any letter and certain other characters, not just letters, okay, don't come for me) and swaps them out for the good stuff listed below. ๐ŸŒธ

heads up: every single date mentioned down here refers to the trigger date of the reminder. not today, not your birthday, the trigger date. periodt. โœจ

  • %a โ€” gets replaced with "on weekday, day month, year". ๐Ÿ—“๏ธ For example, picture this reminder:
REM 18 Oct 1990 +4 MSG Meeting with Bob %a.

On 16 October 1990, it would print "Meeting with Bob on Thursday, 18 October, 1990."

On 17 October 1990, it would print "Meeting with Bob tomorrow."

On 18 October 1990, it would print "Meeting with Bob today."

  • %b โ€” gets replaced with "in diff day's time" where diff is the actual number of days between the current date and the trigger date. (and no, OMITs have zero effect here, they simply do not count. ๐Ÿ™ˆ) For example, consider:
REM 18 Oct 1990 +4 MSG Meeting with Bob %b.

On 16 October 1990, it would print "Meeting with Bob in 2 days' time."

On 17 October 1990, it would print "Meeting with Bob tomorrow."

On 18 October 1990, it would print "Meeting with Bob today."

  • %c โ€” gets replaced with "on weekday". Example: REM 18 Oct 1990 +4 MSG Meeting with Bob %c.

On 16 October 1990, it would print "Meeting with Bob on Thursday."

On 17 October 1990, it would print "Meeting with Bob tomorrow."

On 18 October 1990, it would print "Meeting with Bob today."

  • %d โ€” gets replaced with "day", the day of the month. ๐Ÿ“…
  • %e โ€” gets replaced with "on dd-mm-yyyy".
  • %f โ€” gets replaced with "on mm-dd-yyyy".
  • %g โ€” gets replaced with "on weekday, day month".
  • %h โ€” gets replaced with "on dd-mm".
  • %i โ€” gets replaced with "on mm-dd".
  • %j โ€” gets replaced with "on weekday, month day-th, year". This form appends the characters "st", "nd", "rd" or "th" to the day of the month, as appropriate. โœจ (yes it really does the grammar for you, it's giving considerate.)
  • %k โ€” gets replaced with "on weekday, month day-th".
  • %l โ€” gets replaced with "on yyyy-mm-dd".
  • %m โ€” gets replaced with "month", the name of the month.
  • %n โ€” gets replaced with the number (1 to 12) of the month.
  • %o โ€” gets replaced with " (today)" if and only if the current system date is the same as the date being used by Remind as the current date. ๐Ÿซถ Recall that you can specify a date for Remind to use on the command line. This substitution is not generally useful in a REM command, but is useful in a BANNER command. (See "The BANNER Command.")
  • %p โ€” gets replaced with "s" if the diff between the current date and the trigger date is not 1. You can use this to construct reminders like:
REM 1 Jan +4 MSG %x day%p to go before New Year!
  • %q โ€” gets replaced with "'s" if the diff between the trigger date and the current date is 1. Otherwise, it is replaced with "s'". This can be used as follows:
REM 1 Jan +4 MSG New Year in %x day%q time!
  • %r โ€” gets replaced with the day of the month (01 to 31) padded with a leading zero if needed to pad to two digits.
  • %s โ€” gets replaced with "st", "nd", "rd" or "th" depending on the day of the month.
  • %t โ€” gets replaced with the number of the month (01 to 12) padded to two digits with a leading zero.
  • %u โ€” gets replaced with "on weekday, day-th month, year". This is similar to %a except that "st", "nd", "rd" or "th" is added to the day as appropriate.
  • %v โ€” gets replaced with "on weekday, day-th month".
  • %w โ€” gets replaced with "weekday", the name of the day of the week. ๐ŸŒˆ
  • %x โ€” gets replaced with the diff between the current date and the trigger date. The diff is defined as the actual number of days between these two dates; OMITs are not counted. (Strict date subtraction is performed. no vibes-based math here. ๐Ÿ’€)
  • %y โ€” gets replaced with "year", the year of the trigger date.
  • %z โ€” gets replaced with "yy", the last two digits of the year.
  • %(any_text) โ€” gets replaced with the lookup of any_text in the translation table. It is the equivalent of [_("any_text")] but is more convenient to type. ๐ŸŒธ
  • %<any_text> โ€” gets replaced with the INFO value associated with the header any_text or the empty string if no such INFO value exists. It is the equivalent of [triginfo("any_text")] but is more convenient to type.
  • %_ โ€” (percent-underscore) gets replaced with a newline. You can use this to achieve multi-line reminders. ๐Ÿ“ Note that calendar back-ends vary in how they handle multi-line reminders:
    • Running remind -c preserves newlines in the terminal calendar output.
    • rem2pdf preserves newlines if remind is invoked with the -pp or -ppp option.
    • rem2html preserves newlines if remind is invoked with the -pp option.
    • tkremind preserves newlines.
    • rem2ps converts newlines to spaces. But rem2ps is deprecated; use rem2pdf instead. ๐Ÿšจ
    • The "simple calendar" formats (i.e., remind's -s, -n and -p options) convert newlines to spaces.

All calendar back-ends collapse multiple spaces to a single space and multiple newlines to a single newline.

  • %1 โ€” gets replaced with "now", "m minutes from now", "m minutes ago", "h hours from now", "h hours ago", "h hours and m minutes from now" or "h hours and m minutes ago", as appropriate for a timed reminder. โฐ If the reminder is more than a day in the future, then the phrase will be prefixed by "d days,". Note that unless you specify the -a option, timed reminders will be triggered like normal reminders, and thus a timed reminder that occurred earlier in the day may be triggered. This causes the need for the "...ago" forms. (iykyk ๐Ÿ˜ญ)
  • %2 โ€” gets replaced with "at hh:mmam" or "..pm" depending on the AT time of the reminder.
  • %3 โ€” gets replaced with "at hh:mm" in 24-hour format.
  • %4 โ€” gets replaced with "mm" where mm is the number of minutes between "current" and the trigger date and time specified by AT. If the AT time is earlier than the current time, then the result is negative.
  • %5 โ€” gets replaced with "ma" where ma is the absolute value of the number produced by %4.
  • %6 โ€” gets replaced with "ago" or "from now", depending on the relationship between the AT time and the current time.
  • %7 โ€” gets replaced with the number of hours between the AT time and the current time. It is always non-negative and always between 0 and 23. (That is, for events more than a day away, the days are not counted in %7.)
  • %8 โ€” gets replaced with the number of minutes between the AT time and the current time, after the hours (%7) have been subtracted out. This is a number ranging from 0 to 59.
  • %9 โ€” gets replaced with "s" if the value produced by %8 is not 1.
  • %0 โ€” gets replaced with "s" if the value produced by %7 is not 1.
  • %! โ€” gets replaced with "is" if the current date and time is before the trigger date and the AT time, or "was" if it is after. The %! sequence may be used in a non-timed reminder, in which case only dates are compared.
  • %? โ€” gets replaced with "are" if the current date and time is before the trigger date and the AT time, or "were" if it is after. The %? sequence may be used in a non-timed reminder, in which case only dates are compared.
  • %@ โ€” is similar to %2 but displays the current time.
  • %# โ€” is similar to %3 but displays the current time.
  • %: โ€” gets replaced with " (done)" for a TODO reminder whose trigger date is on or after its COMPLETE-THROUGH date. It is replaced with the empty string in any other situation. Note that because Remind does not display completed TODO reminders in Agenda Mode, this escape sequence is really only useful in Calendar Mode. โœ…
  • %" โ€” (percent-doublequote) is removed. This sequence is not used by the substitution filter, but is used to tell Remind which text to include in a calendar entry when the -c, -s or -p option is chosen. See "CALENDAR MODE". ๐Ÿ’…

๐Ÿ“ Notes ๐Ÿ“

  • Remind normally prints a blank line after each reminder; if the last character of the body is "%", the blank line will not be printed. You can globally suppress the extra blank lines by setting $AddBlankLines to 0.
  • Substitutions a, b, c, e, f, g, h, i, j, k, l, u and v all are replaced with "today" if the current date equals the trigger date, or "tomorrow" if the trigger date is one day after the current date. Thus, they are not the same as substitutions built up from the simpler %w, %y, etc. sequences. ๐Ÿซ 
  • The a, c, e, f, g, h, i, j, k, l, u, v, 2, and 3 substitutions may be preceded by an asterisk (for example, %*c) which causes the word "at" or "on" that would normally be included in the output to be omitted. โœจ
  • The ! and ? substitutions may be preceded by an asterisk (%*! or %*?), in which case the comparison is made between the trigger date and realtoday() instead of today().
  • Any of the substitutions dealing with time (0 through 9) produce undefined results if used in a reminder that does not have an AT keyword. ๐Ÿšจ Also, if a reminder has a delta and may be triggered on several days, the time substitutions ignore the date. Thus, the %1 substitution may report that a meeting is in 15 minutes, for example, even though it may only be in 2 days time, because a delta has triggered the reminder. It is recommended that you use the time substitutions only in timed reminders with no delta that are designed to be queued for timed activation. fr fr, listen to this one. ๐Ÿ˜ญ
  • Capital letters can be used in the substitution sequence, in which case the first character of the substituted string is capitalized (if it is normally a lower-case letter.) ๐Ÿ‘‘
  • All other characters following a "%" sign are simply copied. In particular, to get a "%" sign out, use "%%" in the body. To start the body of a reminder with a space, use "% ", since Remind normally scans for the first non-space character after a MSG, CAL or RUN token. ๐ŸŒธ

๐Ÿ’– EVENTS AND TODOS ๐Ÿ’–

okay bestie so the REM command is normally used to make an EVENT. an event is a thing that happens at a certain time, possibly recurring, and it happens no matter what you do. like birthdays, holidays, meetings, etc... basically everything that occurs on a particular schedule. and once the date of an event has passed, Remind will no longer remind you about the event. bye bye, it's over ๐Ÿ’…

a TODO is different โ€” it's a task you actually have to complete by a specific date or date and time. and if you don't explicitly mark a TODO as done, Remind will keep reminding you about it even past the due date. ๐Ÿ˜ญ it will literally never let it go.

to mark a REM as a TODO, just include the TODO keyword. like:

REM TODO 15 August 2025 ++5 MSG Buy cat food %b.

in Agenda Mode, Remind will start warning you on 10 Aug 2025 that you have to buy cat food in 5 days' time, 4 days' time, etc... ๐Ÿ‘‘

but on 16 Aug 2025, Remind will say "Buy cat food yesterday." and it will keep reminding you of your need to buy cat food until the end of time, or until you mark the TODO as done. no cap, forever. ๐Ÿ’€


โœ… MARKING TODOS AS DONE โœ…

there are two ways to mark a TODO as done, bestie.

  • if the TODO is not recurring, the simplest way is just to remove the TODO designator from the REM command (or honestly, to completely delete it). the former keeps the reminder on the calendar while the latter completely removes it. your call ๐Ÿซถ
  • if a TODO is recurring, use the COMPLETE-THROUGH clause to mark which recurrences have been completed. like:
REM TODO 30 April ++15 COMPLETE-THROUGH 2025-04-30 MSG File taxes

Canadian income taxes must be filed every 30 April. ๐Ÿ‡จ๐Ÿ‡ฆ the above command will remind you to pay taxes in 2026. and if you don't update the COMPLETE-THROUGH date, then after 30 April 2026, Remind will keep reminding you until the end of time that your taxes were due on 30 April 2026. ๐Ÿ˜ญ to indicate that you've paid them, just update the COMPLETE-THROUGH date to 2026-04-30 and then Remind will start reminding you of your 2027 taxes (starting 15 days before the due date.) slay, taxes handled.

it is an error to specify COMPLETE-THROUGH without also specifying TODO. and heads up โ€” the keyword COMPLETED-THROUGH may be used as a synonym for COMPLETE-THROUGH.

๐Ÿ˜ฎโ€๐Ÿ’จ LIMITING REMINDERS ABOUT OVERDUE TODOS ๐Ÿ˜ฎโ€๐Ÿ’จ

even though Remind is perfectly happy to keep reminding you about overdue TODOs for hundreds of years, for some things that's just... pointless, ngl. so if you want Remind to stop nagging you about an overdue TODO after a certain number of days, use the MAX-OVERDUE n clause. in this case, Remind stops reminding you of a TODO that is overdue by more than n days. here's an example:

REM TODO 2025-08-13 ++5 MAX-OVERDUE 5 MSG Task: %b.

Remind starts reminding you of the task on 2025-08-08, because of the ++5 back value. it keeps reminding you of the task after the due date. however, the last time it will remind you will be on 2025-08-18, because of the MAX-OVERDUE clause. starting on 2025-08-19, Remind will no longer remind you of the task since it's probably pointless โ€” it has passed the MAX-OVERDUE period. ๐Ÿ’… closure, finally.


๐Ÿง MORE DETAILS ABOUT TODOS ๐Ÿง

TODOs are treated specially only in Agenda Mode. in Calendar Mode, they appear in the calendar exactly as a normal event would. no special treatment there, periodt.

TODOs are implemented internally by using the COMPLETE-THROUGH date plus one day as the starting point for Remind's date-scanning algorithm. so if you have a recurring TODO without a COMPLETE-THROUGH clause, then Remind starts scanning from the beginning of time, which we all know is 1 January 1990. โœจ consider this command:

REM TODO Wed +7 MSG Take out the trash %a (%b)

running that command in Agenda Mode on 2025-08-13 yields the following output:

Take out the trash on Wednesday, 3 January, 1990 (13006 days ago)

Remind is very persistent about reminding you of tasks! ๐Ÿ˜ญ if you take out the trash and mark it done:

REM TODO Wed +7 COMPLETE-THROUGH 2025-08-13 MSG Take out the trash %a (%b)

then you get this:

Take out the trash on Wednesday, 20 August, 2025 (in 7 days' time)

you can use FROM and UNTIL to limit the recurrence interval of tasks just as you can with events. for example, if you're house-sitting for the month of August and need to water plants every Wednesday:

REM TODO Wed +7 FROM 2025-08-06 UNTIL 2025-08-27 MSG Plants %b.

running that command on 13 Aug yields: "Plants 7 days ago." because you have not told Remind that you completed the first watering. ๐Ÿ™ˆ if you finish your duties and add a COMPLETE-THROUGH date of 2025-08-27, then Remind never reminds you of that task in the future. iconic.

and in Purge Mode, Remind will not purge TODOs unless they have been marked as complete. in the case of a recurring TODO, Remind will not purge it until the last occurrence is marked as complete.


๐Ÿšซ THE OMIT COMMAND ๐Ÿšซ

besides being a keyword in the REM command, OMIT is a command all on its own. its syntax is:

OMIT weekday [weekday...]

or:

OMIT [day] month [year]

or:

OMIT [day1] month1 [year1] THROUGH [day2] month2 [year2]

the OMIT command is used to "globally" omit certain days (usually holidays). these globally-omitted days are skipped by the "-" and "+" forms of back and delta, but not by the "--" and "++" forms. some examples:

OMIT Saturday Sunday
OMIT 1 Jan
OMIT 7 Sep 1992
OMIT 15 Jan THROUGH 14 Feb
OMIT May     # Equivalent to OMIT May 1 THROUGH May 31
OMIT 25 Dec THROUGH 4 Jan
OMIT 2023-05-03 THROUGH 2023-05-12
OMIT Jun THROUGH July  # Equivalent to OMIT Jun 1 THROUGH July 31

let's break these down, bestie:

  • the first example omits every Saturday and Sunday. super useful for reminders that shouldn't trigger on weekends. ๐Ÿ›Œ
  • the second example specifies a holiday that occurs on the same date each year โ€” New Year's Day. ๐ŸŽ‰
  • the third example specifies a holiday that changes each year โ€” Labour Day. for these types of holidays, you must create an OMIT command for each year. (later, in the description of expressions and some of the more advanced features of Remind, you will see how to automate this for some cases.)

as with the REM command, you can use shorthand specifiers for dates; the following are equivalent:

OMIT 7 Sep 1992
OMIT 1992-09-07

for convenience, you can use a delta and MSG or RUN keyword in the OMIT command. the following sequences are equivalent:

OMIT 1 Jan
REM 1 Jan +4 MSG New year's day is %b!

and

OMIT 1 Jan +4 MSG New year's day is %b!

the THROUGH keyword lets you conveniently OMIT a range of days. for example, the following sequences are equivalent:

OMIT 3 Jan 2011
OMIT 4 Jan 2011
OMIT 5 Jan 2011

and

OMIT 3 Jan 2011 THROUGH 5 Jan 2011
heads up! Remind has a compiled-in limit to the number of full OMITs. if you omit a range of N fully-specified (i.e., year included) days, then N full OMITs are used up. trying to omit a very large range may result in the error "Too many full OMITs". ๐Ÿ˜ฌ

you can make a THROUGH OMIT do double-duty as a REM command as long as both dates are fully specified:

OMIT 6 Sep 2010 THROUGH 10 Sep 2010 MSG Vacation

if you use a THROUGH clause, then either the year must be supplied before and after the THROUGH, or it must be missing before and after the THROUGH. the following are legal:

OMIT 25 Dec THROUGH 6 Jan
OMIT 25 Dec 2024 THROUGH 6 Jan 2025

but the following are not:

OMIT 25 Dec THROUGH 6 Jan 2025
OMIT 25 Dec 2024 THROUGH 6 Jan

you can debug your global OMITs with the following command:

OMIT DUMP

the OMIT DUMP command prints the current global omits to standard output. ๐Ÿ›โœจ


๐Ÿ”€ THE BEFORE, AFTER AND SKIP KEYWORDS ๐Ÿ”€

normally, days that are omitted โ€” whether by a global OMIT command or the local OMIT or OMITFUNC keywords in a REM statement โ€” only affect the counting of the -back or the +delta. for example, suppose you have a meeting every Wednesday. suppose, too, that you have indicated 11 Nov as a holiday:

OMIT 11 Nov +4 MSG Remembrance Day
REM Wed +1 MSG Code meeting %b.

the above sequence will issue a reminder about a meeting for 11 November 1992, which is a Wednesday. this is probably incorrect. ๐Ÿ˜ฌ there are three options:

  • BEFORE โ€” this keyword moves the reminder to before any omitted days. thus, in the above example, use of BEFORE would cause the meeting reminder to be triggered on Tuesday, 10 November 1992.
  • AFTER โ€” this keyword moves the reminder to after any omitted days. in the above example, the meeting reminder would be triggered on Thursday, 12 November 1992.
  • SKIP โ€” this keyword causes the reminder to be skipped completely on any omitted days. thus, in the above example, the reminder would not be triggered on 11 November 1992. however, it would be triggered as usual on the following Wednesday, 18 November 1992.

the BEFORE and AFTER keywords move the trigger date of a reminder to before or after a block of omitted days, respectively. suppose you normally run a backup on the first day of the month. however, if the first day of the month is a weekend or holiday, you run the backup on the first working day following the weekend or holiday. you could use:

REM 1 OMIT Sat Sun AFTER RUN do_backup

let's examine how the trigger date is computed. ๐Ÿ” the 1 specifies the first day of the month. the local OMIT keyword causes the AFTER keyword to move the reminder forward past weekends. finally, the AFTER keyword will keep moving the reminder forward until it has passed any holidays specified with global OMIT commands. chef's kiss. ๐Ÿ’…

โœจ TIMEZONE SUPPORT โœจ

okay bestie, the REM command has an optional TZ keyword, and it has to be followed by the case-sensitive time zone name that the command should be interpreted in. โฐ Heads up though: if you use the TZ keyword, you also have to use an AT clause. No AT, no TZ, them's the rules. Here are some examples:

REM Wednesday AT 14:00 TZ America/Toronto MSG 2PM Eastern (%2).
REM Wednesday AT 23:59 TZ America/Los_Angeles SATISFY [$Td == 13] MSG Foo %b %2.

Inside a SATISFY clause and an OMITFUNC function, every trigger function and the trigger date get interpreted in the time zone you named in the REM command. Outside the REM command, though? The trigger functions get adjusted to your local time zone instead. So if your local zone is UTC and we feed Remind this file on 2025-09-04 UTC:

SET $AddBlankLines 0
BANNER %
REM Wednesday AT 14:00 TZ America/Toronto MSG 2PM Eastern (%2).
set a $T
set b $Tt
REM MSG a = [a], b = [b]
REM Wednesday AT 23:59 TZ America/Los_Angeles SATISFY [$Td == 13] MSG Foo %b %2.
set c $T
set d $Tt
REM MSG c = [c], d = [d]

then the output is exactly this:

a = 2025-09-10, b = 18:00
c = 2026-05-14, d = 06:59

And why, you ask? ๐Ÿ’… Because the trigger date of the first one (Wednesday, 2025-09-10 at 14:00 Eastern time) is 2025-09-10 at 18:00 UTC. In the second case, Wednesday, 13 May 2026 is the SATISFY-ied trigger date, and that gets adjusted to Thursday, 14 May 2026 at 06:59 UTC because of the time zone adjustment. math is mathing. ๐Ÿงฎ

If you drop an invalid time zone name after TZ, the results are undefined. And like we said โ€” time zone names are case-sensitive, so America/Toronto is valid but america/toronto is absolutely not. ๐Ÿ’€

If you're on a system that stores time zone data in /usr/share/zoneinfo, then Remind will try to validate the time zone name and will warn you if it looks invalid. But say you want to specify a time zone that genuinely has no file under /usr/share/zoneinfo and you want the warning to shush โ€” just prefix the time zone name with "!". Like so:

REM Thursday AT 14:45 TZ !EST+5EDT,M3.2.0/2,M11.1.0/2 MSG Old TZ format

In a reminder that has the TZ keyword, OMIT dates are evaluated in the time zone you specified. Example time: suppose your local zone is America/Toronto and you've got this script:

# A Friday
OMIT 2025-09-05

# A Saturday
OMIT 2025-09-13

REM Saturday AT 01:00 TZ Europe/Amsterdam SKIP MSG Early Sat AM

On 2025-09-05 in the America/Toronto time zone, the reminder will trigger. Even though 2025-09-05 has been OMITted, the SKIP keyword evaluates the date in the Europe/Amsterdam time zone, and 2025-09-06 (the trigger date) is not omitted. slay. โœจ

Conversely, on 2025-09-12 in the America/Toronto time zone, the reminder will not trigger. Even though 2025-09-12 is not OMITted, 2025-09-13 is, and that's the trigger date in the Europe/Amsterdam time zone. caught in 4k. ๐Ÿ˜ญ


๐ŸŒธ THE DO, INCLUDE AND SYSINCLUDE COMMANDS ๐ŸŒธ

Remind lets you pull other files into your reminder script, kinda like the C preprocessor's #include directive. For example, you might organize different reminders into different files like this:

INCLUDE holidays.rem
INCLUDE birthdays.rem
INCLUDE "quote files with spaces.rem"

INCLUDE files can nest up to a depth of 8. And as you can see above, if a filename has spaces in it (which is not recommended! ๐Ÿ™ˆ) you can wrap the filename in double-quotes.

If you specify a filename of "-" in the INCLUDE command, Remind will start reading from standard input.

If you specify a directory as the argument to INCLUDE, then Remind will process all the files (but not subdirectories!) in that directory that match the shell pattern "*.rem". They get processed in sorted order, and that sort order matches whatever the shell uses when it expands "*.rem".

Now listen, this next bit is important ๐Ÿ‘‘: the file specified by an INCLUDE command is interpreted relative to the current working directory of the Remind process. If you want to include a file relative to the directory containing the currently-processing file, use DO instead. For example, if the current file is /home/user/.reminders/foo.rem and Remind's working directory is /home/user, then:

# Read /home/user/.reminders/bar.rem
DO bar.rem

# Read /usr/share/bar.rem - absolute path
DO /usr/share/bar.rem

# Read /home/user/bar.rem
INCLUDE bar.rem

# Read /usr/share/bar.rem - absolute path
INCLUDE /usr/share/bar.rem

Arguably, INCLUDE should have worked the way DO does right from the start, but changing it would've broken backward-compatibility, hence DO existing. it's giving "we fixed it by adding a whole new thing." ๐Ÿ’…

Note that if the currently-processing reminders file was specified as a symbolic link to a file that's not in the same directory as the symbolic link itself, DO will fail. Remind does not resolve the real path of symbolic links, so you should avoid using symbolic links to files. ๐Ÿšซ๐Ÿ”—

The SYSINCLUDE command is similar to DO, except it looks for relative pathnames under the system directory that holds standard reminder scripts. For this installation of Remind, that system directory is "/usr/share/remind".


๐Ÿ’œ THE RETURN COMMAND ๐Ÿ’œ

The RETURN command makes Remind ignore whatever's left in the file it's currently processing. It's a quick way to "exit" out of an included file (though ngl it works at the top level too).

Here's an example of how RETURN might get used:

IF already_done
    RETURN
ENDIF
set already_done 1
preserve already_done
# Do expensive processing here

๐Ÿ”ฅ THE RUN COMMAND ๐Ÿ”ฅ

So, if you include other files in your reminder script, you might not fully trust what's in them. For example, they could contain RUN-type reminders that get used to poke at your files or do other undesired stuff. ๐Ÿ˜ฑ The RUN command can lock that down: if you include the command RUN OFF in your top-level reminder script, then any reminder or expression that would normally execute a system command is disabled. RUN ON brings system command execution back.

But listen โ€” the RUN ON command can only be used in your top-level reminder script. It will not work in any files accessed by the INCLUDE command. That's on purpose, to protect you from someone sneaking a RUN ON into an included file. ๐Ÿ‘€ However, the RUN OFF command can be used at top level or in an included file. no cap.

If you run Remind with the -r command-line option, RUN-type reminders and the shell() function get disabled, regardless of any RUN commands in the reminder script. However, any command supplied with the -k option will still be executed. โš ๏ธ

Remind also has a few other security features, bestie:

  • It will not read a file that is group- or world-writable.
  • It will not run set-uid.
  • If it reads a file you don't own, it disables RUN and the shell() function.
  • And if it's run as root, it will only read files owned by root.
Note that if Remind reads standard input, it does not attempt to check the ownership of standard input, even if it's coming from a file, and hence does not disable RUN and shell() in that situation. ๐Ÿ™ˆ

โœจ THE EXPR COMMAND โœจ

Remind lets you completely disable expression evaluation. That's handy if you're running Remind on a somewhat-untrustworthy file that isn't expected to contain expressions. To disable expression evaluation, use:

EXPR OFF

If Remind runs into an expression while EXPR OFF is in effect, it returns an error. ๐Ÿ’€

To re-enable expression evaluation, use:

EXPR ON

And just like with RUN ON, EXPR ON can only be used in the top-level script, not in an included file. ๐Ÿซถ


๐ŸŽ€ THE INCLUDECMD COMMAND ๐ŸŽ€

Remind lets you execute a shell command and then evaluate the output of that command as if it were an included file. For example, you could have scripts that extract reminders out of a database and print them on stdout as REM commands. Here's an example:

INCLUDECMD extract_reminders_for dfs

We're assuming here that the command "extract_reminders_for" extracts reminders out of a central database for the named user. Another use-case for INCLUDECMD: if you've got your reminders stored in a file in some non-Remind format, you can write a command that transforms them into Remind format, and then Remind can "include" the file with an appropriate INCLUDECMD command. iconic. ๐Ÿ’…

Note that if RUN is disabled, then INCLUDECMD will fail with the error message "RUN disabled".

Remind arranges things so that when the command specified by INCLUDECMD is executed, its standard input is opened to /dev/null.

INCLUDECMD passes the rest of the line to popen(3), which means the command gets executed by the shell. Because of that, shell meta-characters may need escaping or arguments may need quoting, depending on what you're trying to do. Remind itself does not perform any modification of the command line (apart from the normal [expr] expression-pasting mechanism).

If the command passed to INCLUDECMD begins with an exclamation mark "!", then Remind disables RUN for the output of that command. So if you're running a command whose output you don't quite trust, prefix it with "!" so that any RUN commands it emits will fail. ๐Ÿ”’

An INCLUDECMD command counts towards the INCLUDE nesting depth. For any given Remind run, a given INCLUDECMD command is only executed once and the results are cached. For example, if you generate a calendar, each unique INCLUDECMD command gets run just once โ€” not once for each day of the produced calendar. "Uniqueness" is determined by looking at the command that will be passed to the shell, so if (for example) your INCLUDECMD uses expression-pasting that results in differences depending on the value of today(), then each unique version of the command will be executed once.

If a given reminder file contains more than one identical INCLUDECMD, only the first one will actually be executed. All the subsequent identical ones will use the cached output from the first one. periodt. โœจ


๐ŸŒˆ THE BANNER COMMAND ๐ŸŒˆ

When Remind first issues a reminder, it prints a message like this:

Reminders for Friday, 30th October, 1992 (today):

(The banner is not printed if any of the calendar-producing options is used, or if the -k option is used.)

The BANNER command lets you change the format. It should appear before any REM commands. The format is:

BANNER format

The format is similar to the body of a REM command. It gets passed through the substitution filter, with an implicit trigger of the current system date. So the default banner is equivalent to:

BANNER Reminders for %w, %d%s %m, %y%o:

You can disable the banner completely with BANNER %. Or you can create a custom banner, main character energy only:

BANNER Hi - here are your reminders for %y-%t-%r:

๐Ÿ’… CONTROLLING THE OMIT CONTEXT

Okay bestie, so sometimes you need to temporarily switch up the global OMITs that are in force for just a few reminders, right? Not forever, just a little vibe shift. Three commands let you do exactly that:

  • PUSH-OMIT-CONTEXT โ€” saves the current global OMITs onto an internal stack. Like screenshotting your current situation before you mess with it ๐Ÿ“ธ
  • CLEAR-OMIT-CONTEXT โ€” wipes all the global OMITs and gives you a "clean slate." Fresh start energy โœจ
  • POP-OMIT-CONTEXT โ€” restores the global OMITs that were saved by the most recent PUSH-OMIT-CONTEXT. Undo button, but for OMITs ๐Ÿซถ

So say you've got a block of reminders that needs a clear OMIT context, and also they're out here introducing unwanted global OMITs that would interfere with later reminders (rude of them, honestly). You'd do this:

PUSH-OMIT-CONTEXT   # Save the current context
CLEAR-OMIT-CONTEXT  # Clean the slate
# Block of reminders goes here
POP-OMIT-CONTEXT    # Restore the saved omit context

See how it's just wrapping the messy part in a little hug? ๐ŸŽ€


๐Ÿงฎ EXPRESSIONS

In certain contexts (we'll get to which ones later, patience bestie ๐Ÿ’œ), Remind will accept expressions for evaluation. Remind expressions look a lot like C expressions, but they operate on totally different types of objects. Same font, different lore.

๐ŸŒˆ DATA TYPES

Remind expressions operate on five types of objects:

  • INT โ€” the INT data type is the integers representable in one machine word. It corresponds to the C int type.
  • STRING โ€” the STRING data type is strings of characters. It's kinda comparable to a C character array, but honestly it's way more like the string type in BASIC.
  • TIME โ€” the TIME data type is used for two different purposes: representing a time of day with one-minute precision, or representing a duration with one-minute precision. The context of where a TIME is used decides which one it means.
  • DATE โ€” the DATE data type is dates (later than 1 January 1990). Internally, DATE objects are stored as the number of days since 1 January 1990.
  • DATETIME โ€” the DATETIME data type is a date and time together. Internally, DATETIME objects are stored as the number of minutes since midnight, 1 January 1990. You can think of a DATETIME object as being the combination of DATE and TIME parts. Iconic combo meal ๐Ÿ”๐ŸŸ

Let me expand on the big ones, because they have lore:

๐Ÿฆ‹ STRING (the chaotic one)

Remind normally expects to be running in a UTF-8 environment. And in that environment, there is a real difference between bytes and characters โ€” because in UTF-8, a character can be represented by a sequence of more than one byte. For example, in a UTF-8 environment, the string "๐Ÿ™‚" contains one character but four bytes. And the string "รฉรฉn" contains three characters but five bytes. Not me getting personally attacked by byte counts ๐Ÿ˜ญ

Remind has a set of functions that work on bytes, namely index, strlen and substr, and several more. These are not safe to use on multi-byte strings. Instead use mbindex, mbstrlen and mbsubstr, plus the mb variants of the others. If you know for sure that a string contains only single-byte characters, then the byte-oriented versions may be used, and they're faster than the multi-byte versions. Speed vs safety, the eternal struggle ๐Ÿ’€

โฐ TIME (dual purpose, main character)

In contexts where a TIME represents a time of day, it may range from 00:00 to 23:59 and is stored internally as an integer from 0 to 1439 representing the number of minutes since midnight.

In contexts where a TIME represents a duration, there is no upper limit on the hour component โ€” beyond the restriction that a duration expressed in minutes must fit into the signed integer type of your CPU architecture. Internally, a duration is stored as an integer number of minutes.

๐Ÿ“… DATE

The DATE data type consists of dates (later than 1 January 1990). Internally, DATE objects are stored as the number of days since 1 January 1990.

๐Ÿ•ฐ๏ธ DATETIME

Already told you above but repeating for the ones in the back: it's a date and time together, stored internally as the number of minutes since midnight, 1 January 1990, and you can think of it as DATE + TIME parts combined. Periodt.


๐ŸŽ€ CONSTANTS

Here are examples of constants in Remind expressions โ€” these illustrate the vibes:

INT constants

12, 36, -10, 0, 1209, 0x1F, 0xfe00

(the last two demonstrate the use of hexadecimal constants ๐Ÿ‘‘)

STRING constants

"Hello there", "This is a test", "\nHello\tThere", "", "ฯ€ is Cool! ๐Ÿ™‚"

Note that the empty string is represented by "". Remind supports the escape sequences "\a", "\b", "\f", "\n", "\r", "\t" and "\v", which have the same meanings as their counterparts in C. It also supports "\xAB" where A and B are hexadecimal digits; this operates just as in C. The "\x" must be followed by one or two hex digits; the escape sequence "\x00" is not permitted.

To include a quote in a string, use "\"". Any other character preceded by a backslash is inserted into the string as-is, but the backslash itself is removed. To include a backslash in a string, use "\\".

TIME constants

12:33, 0:01, 14:15, 16:42, 12.16, 13.00, 1.11, 4:30PM, 12:20am

Note that TIME constants may be written in 24-hour format or in common "AM/PM" format. If you use "AM/PM" format, then the hour can range from 1 to 12. Either a period or colon can be used to separate the minutes from the hours. However, Remind will consistently output times in 24-hour format using only one separator character. (The output separator character is chosen at compile-time. Not your call, bestie ๐Ÿซ )

If the TIME is used where Remind expects a time-of-day (for example, in an AT clause), then it can be written in 24-hour format (ranging from 00:00 to 23:59) or 12-hour format (ranging from 12:00am to 11:59pm). If the TIME is used where Remind expects a duration, it must not have an am or pm suffix, and the hour can be as large as you want, so long as the total number of minutes in the duration fits in a signed integer variable.

For convenience, a TIME constant may be surrounded by single quotes to match DATE and DATETIME constants, but these quotes are optional. That is, 12:56 and '12:56' represent the same TIME constant. Slay, options ๐Ÿ’…

DATE constants

DATE constants are expressed as 'yyyy/mm/dd' or 'yyyy-mm-dd', and the single quotes must be supplied. This is what distinguishes date constants from division or subtraction of integers. Examples:

'1993/02/22', '1992-12-25', '1999/01/01'

Note that DATE values are printed without the quotes. Although either '-' or '/' is accepted as a date separator on input, when dates are printed, only one will be used. The choice of whether to use '-' or '/' is made at compile-time. Also note that versions of Remind prior to 03.00.01 did not support date constants โ€” in those versions, you must create dates using the date() function. And versions prior to 03.00.02 did not support the '-' date separator. History lesson, free of charge ๐Ÿ“š

DATETIME constants

DATETIME constants are expressed similarly to DATE constants, with the addition of an @HH:MM part, optionally followed by am or pm. For example:

'2008-04-05@23:11', '1999/02/03@14:06', '2001-04-07@08:30', '2020-01-01@3:20pm'

DATETIME values are printed without the quotes. Notes about date and time separator characters for DATE and TIME constants apply also to DATETIME constants.


โœ… ZERO VALUES AND TRUE/FALSE

All types have an associated zero value, which is treated as false by the IF command, the IIF function, and the logical operators. The zero values are:

  • INT โ€” 0
  • DATE โ€” '1990-01-01'
  • TIME โ€” 00:00
  • DATETIME โ€” '1990-01-01@00:00'
  • STRING โ€” "" (the empty string)

Any value other than the zero value is treated as true. That's it, that's the whole truthiness situation ๐Ÿซถ


๐Ÿ”ฅ OPERATORS

Remind has the following operators. Operators on the same line have equal precedence, while operators on lower lines have lower precedence than those on higher lines. The operators approximately correspond to C operators.

!  -            (unary logical negation and arithmetic negation)
*  /  %         (multiplication, division, modulus)
+  -            (addition/concatenation, subtraction)
<  <=  >  >=    (comparisons)
==  !=          (equality and inequality tests)
&&              (logical AND)
||              (logical OR)

๐Ÿ’œ DESCRIPTION OF OPERATORS

  • ! โ€” Logical negation. Can be applied to any type. If the operand is non-zero, returns 0. Otherwise, returns 1.
  • - โ€” Unary minus. Can be applied to an INT. Returns the negative of the operand.
  • * โ€” Multiplication. Returns the product of two INTs. Alternatively, if one argument is a STRING and the other an INT, returns a STRING consisting of the INT number of repeats of the original STRING. In this case, the INT argument cannot be negative.
  • / โ€” Integer division. Returns the quotient of two INTs, discarding the remainder.
  • % โ€” Modulus. Returns the remainder upon dividing one INT by another.
  • + โ€” Has several uses. These are:
    • INT + INT โ€” returns the sum of two INTs.
    • INT + TIME or TIME + INT โ€” returns a TIME obtained by adding INT minutes to the original TIME. The result will always range from 00:00 through 23:59.
    • TIME + TIME โ€” treats the second TIME parameter as a duration, converting it to an integer number of minutes past midnight, and then performs addition as with TIME + INT.
    • INT + DATE or DATE + INT โ€” returns a DATE obtained by adding INT days to the original DATE.
    • INT + DATETIME or DATETIME + INT โ€” returns a DATETIME obtained by adding INT minutes to the original DATETIME.
    • DATETIME + TIME or TIME + DATETIME โ€” treats the TIME parameter as a duration, converting it to an integer number of minutes past midnight, and then performs addition as with DATETIME + INT.
    • STRING + STRING โ€” returns a STRING that is the concatenation of the two original STRINGs.
    • STRING + anything or anything + STRING โ€” converts the non-STRING argument to a STRING, and then performs concatenation. See the coerce() function.
  • - โ€” Has several uses. These are:
    • INT - INT โ€” returns the difference of two INTs.
    • DATE - DATE โ€” returns (as an INT) the difference in days between two DATEs.
    • TIME - TIME โ€” returns (as an INT) the difference in minutes between two TIMEs.
    • DATETIME - DATETIME โ€” returns (as an INT) the difference in minutes between two DATETIMEs.
    • DATE - INT โ€” returns a DATE that is INT days earlier than the original DATE.
    • TIME - INT โ€” returns a TIME that is INT minutes earlier than the original TIME.
    • DATETIME - INT โ€” returns a DATETIME that is INT minutes earlier than the original DATETIME.

DATETIME - TIME

okay so this one coerces the TIME to an INT and then does the subtraction thing exactly like we just talked about. math is math bestie ๐Ÿ’…

<, <=, >, and >=

These are the comparison operators, and they're lowkey the chillest ones here โ€” they'll take operands of any type, but plot twist: both operands have to be the same type or it's not happening. โœ‹

They return 1 if the comparison is true, and 0 if it's false. Simple. Clean. Iconic.

heads up bestie: string comparison follows the lexical ordering of characters on your system, and upper and lower case are distinct for these operators. so "a" and "A" are NOT the same vibe, periodt.

==, !=

== tests for equality โ€” returns 1 if its operands are equal, 0 if they're not. != tests for inequality, obvs. ๐Ÿซถ

If the operands are not of the same type, == returns 0 and != returns 1. and yeah, again: string comparisons are case-sensitive. no cap.

&&

This is the logical AND operator, bestie. It returns the second operand if both operands are non-zero. Otherwise, it returns whichever operand is zero.

Operands can be any type and "zero" gets interpreted as appropriate for each operand's type. very flexible of it ngl โœจ

||

And this is the logical OR. It returns the first operand that is non-zero; if both operands are zero, then it returns the second operand.

Operands can be any type and "zero" is interpreted as appropriate for each operand's type. same energy as &&, just the OR-flavored version. ๐ŸŒˆ


๐ŸŽ€ NOTES ๐ŸŽ€

okay so here's the tea: if the result of an addition, subtraction or multiplication operation would not fit in a C "int" type, Remind issues a "Number too high" error. Unlike C, integer operations will not simply give you the wrong answer in case of overflow. she said "we do not do silent wrongness here" ๐Ÿ’…โœจ

Operators of equal precedence are always evaluated from left to right, except where parentheses dictate otherwise. This is important, because the enhanced "+" operator is not necessarily associative. For example:

1 + 2 + "string" + 3 + 4  yields "3string34"
1 + (2 + "string") + (3 + 4)  yields "12string7"
12:59 + 1 + "test"  yields "13:00test"
12:59 + (1 + "test")  yields "12:591test"

like look at that โ€” the parentheses completely change the vibe. math has trust issues fr fr ๐Ÿ˜ญ

The logical operators are so-called short-circuit operators, as they are in C. This means that if the first operand of || is true, then the second operand is not evaluated. Similarly, if the first operand of && is false, then the second operand is not evaluated. she skips the whole second half when she already knows the answer. efficient queen ๐Ÿ‘‘


๐Ÿฆ‹ VARIABLES ๐Ÿฆ‹

Remind allows you to assign values to variables. The SET command is used as follows:

SET var expr

Var is the name of a variable. It must start with a letter or underscore, and consist only of letters, digits and underscores. Only the first 64 characters of a variable name are significant. Variable names are not case sensitive; thus, "Afoo" and "afOo" are the same variable. โœจ

Examples:

SET a 10 + (9*8)
SET b "This is a test"
SET mydir getenv("HOME")
SET time 12:15
SET date today()

Note that variables themselves have no type. They take on the type of whatever you store in them. they're shapeshifters, basically. ๐Ÿ’ซ

Variables set with SET or on the command-line with -ivar=expr have global scope.

To delete a variable, use the UNSET command:

UNSET var [var...]

For example, to delete all the variables declared above, use:

UNSET a b mydir time date

bye girl ๐Ÿ‘‹ gone. deleted. not tracked.


๐Ÿ‘‘ SYSTEM VARIABLES ๐Ÿ‘‘

In addition to the regular user variables, Remind has several "system variables" that are used to query or control the operating state of Remind. System variables are available starting from version 03.00.07 of Remind.

All system variables begin with a dollar sign '$'. They can be used in SET commands and expressions just as regular variables can. All system variables always hold values of a specified type. In addition, some system variables cannot be modified, and you cannot create new system variables. System variables can be initialized on the command line with the -i option, but you may need to quote them to avoid having the shell interpret the dollar sign. System variable names are not case-sensitive.

The following system variables are defined. Those marked "read-only" cannot be changed with the SET command. All system variables hold values of type INT, unless otherwise specified. ๐Ÿ’…

$AddBlankLines

If set to 1 (the default), then Remind normally prints a blank line after the banner and each reminder. (This can be suppressed by ending the reminder or banner with a single percent sign.) If $AddBlankLines is set to 0, then Remind does not print the blank line. In this case, ending a reminder with % has no effect. If you do want a blank line after a reminder, end it with %_ to insert a newline. ๐ŸŒธ

$CalcUTC

If 1 (the default), then Remind uses C library functions to calculate the number of minutes between local and Universal Time Coordinated. This affects astronomical calculations (sunrise() for example.) If 0, then you must supply the number of minutes between local and Universal Time Coordinated in the $MinsFromUTC system variable. ๐Ÿงš

$CalMode (read-only)

If non-zero, then the -c option was supplied on the command line.

$CalType (read-only, STRING type)

If the -c, -s or -p command-line options were used, then this variable has the value "monthly". If -c+, -s+ or -p+ were used, then "weekly". Otherwise, "none".

$Daemon (read-only)

If "daemon mode" -z was invoked, contains the number of minutes between wakeups. If not running in daemon mode, contains 0. In server mode (either -z0 or -zj), contains -1.

$DateSep (STRING type)

This variable can be set only to "/" or "-". It holds the character used to separate portions of a date when Remind prints a DATE or DATETIME value.

$DedupeReminders

If this variable is set to 1, then Remind will suppress duplicate reminders. A given reminder is considered to be a duplicate of a previous one if it has the exact same trigger date, trigger time, and body. By default, this variable is set to 0 and Remind does not suppress duplicate reminders.

As an example, consider the following reminder file:

SET $DedupeReminders 1
REM Wednesday MSG Phooey
REM 20 MSG Phooey

On Wednesday, 20 November 2024, only one "Phooey" will be issued. In December of 2024, "Phooey" will be issued every Wednesday as well as on Friday, 20 December 2024

If you set $DedupeReminders to 0, then Remind does not even track reminders to detect duplicates. Consider the following example:

SET $DedupeReminders 0
REM Wednesday MSG Hello
SET $DedupeReminders 1
REM Wednesday MSG Hello

Every Wednesday, Remind will issue two "Hello" reminders. Because $DedupeReminders was 0 when the first "Hello" was issued, it won't be tracked for potential duplicates. ๐Ÿ’€

Duplicates are detected after all variable expansion and substitutions have been done. Consider the following:

SET $DedupeReminders 1
set a "foo"
REM MSG [a]
set a "bar"
REM MSG [a]
set a "foo"
REM MSG [a]

The first REM will trigger and print "foo". The second will trigger and print "bar". The third will not trigger because it's a duplicate of the first "foo". she said "I've seen that exact reminder before, I'm not doing it twice." ๐Ÿ™ˆ

$DefaultColor (STRING type)

This variable can be set to a string that has the form of three space-separated numbers. Each number must be an integer from 0 to 255, or all three numbers must be -1. The default value of $DefaultColor is "-1 -1 -1", which suppresses default coloring of MSG-type reminders. If you set $DefaultColor to any other value, then all MSG-, MSF- and CAL-type reminders are effectively converted into SPECIAL COLOR reminders whose color value is specified by $DefaultColor. ๐ŸŽจ

Unlike other system variables, the value of $DefaultColor is not preserved between calendar iterations; rather, it is reset to "-1 -1 -1" at the start of each iteration.

You can spell the variable name $DefaultColour instead of $DefaultColor; they are aliases for exactly the same variable. (british spelling girlies, we see you ๐Ÿ’œ)

$DefaultPrio

The default priority assigned to reminders without a PRIORITY clause. You can set this as required to adjust the priorities of blocks of reminders without having to type priorities for individual reminders. At startup, $DefaultPrio is set to 5000; it can range from 0 to 9999.

$DefaultDelta

You can set this variable to a number from 0 through 10000. If set to a non-zero number, then Remind triggers any REM statement that lacks a delta as if it had a delta of ++$DefaultDelta. By default, $DefaultDelta is zero.

$DefaultTDelta

The default time delta used if no +N is given in an AT clause. This is normally 0, but can be set with the -tt option or explicitly set in your script. If $DefaultDelta is non-zero, you can use an explicit delta of +0 in an AT clause to countermand the default delta. โœจ

$DeltaOverride (read-only)

If non-zero, corresponds to the n argument given to a -tn command-line option.

$DontFork (read-only)

If non-zero, then the -c option was supplied on the command line.

$DontTrigAts (read-only)

The number of times that the -a option was supplied on the command line.

$DontQueue (read-only)

If non-zero, then the -q option was supplied on the command line.

$EndSent (STRING type)

Contains a list of characters that end a sentence. The MSF keyword inserts two spaces after these characters. Initially, $EndSent is set to ".!?" (period, exclamation mark, and question mark.) ๐ŸŒŸ

$EndSentIg (STRING type)

Contains a list of characters that should be ignored when MSF decides whether or not to place two spaces after a sentence. Initially, is set to "'>)]}"+CHAR(34) (single-quote, greater-than, right parenthesis, right bracket, right brace, and double-quote.)

For example, the default values work as follows:

MSF He said, "Huh! (Two spaces will follow this.)"  Yup.

because the final parenthesis and quote are ignored (for the purposes of spacing) when they follow a period. iykyk ๐Ÿ’…

$ExpressionTimeLimit

Set this to some non-zero value n and literally any expression that takes longer than n seconds to evaluate gets aborted and hands you back an error. It's the bouncer at the club ๐Ÿšซ โ€” keeps maliciously-crafted expressions from doing a denial-of-service on you.

Inside an included file, $ExpressionTimeLimit can only be lowered from its current value (no sneaky raising it back up ๐Ÿ™ˆ). In the top-level file tho? Set it to whatever you want โ€” including zero, which disables the time limit entirely.


$FirstIndent

How many spaces to indent the first line of an MSF-type reminder. Default is 0.


$FirstIndent? no bestie that was the last one ๐Ÿ’… โ€” moving on:

$FoldYear

The standard Unix library functions can be kinda dramatic about dates later than 2037 ๐Ÿ˜ญ. So if you set this variable to 1, the UTC calculations "fold back" years later than 2037 before handing them to those Unix library functions.

Example time: to figure out whether daylight saving time is in effect in June, 2077, the year gets "folded back" to 2027 โ€” because both years begin on a Friday, and both are non-leapyears. The DST rules are thus presumed to be identical for both years, and the Unix library functions can handle 2027 just fine. โœจ

By default this variable is 0. Set it to 1 if the sun or UTC functions are misbehaving for years greater than 2037. Also peep the section "MACHINES WITH A 32-BIT TIME_T TYPE".


$FormWidth

The maximum width of each line of text when formatting MSF-type reminders. The default is the width of the terminal in columns, minus 8 โ€” but clamped at a minimum of 20 and a maximum of 500. If standard output is not a terminal, then the default is 72.

Heads up: if an MSF-type reminder contains a word too long to fit in this width, it will not be truncated โ€” the width limit will be ignored. The long word wins. Periodt.

$HideCompletedTodos (read-only)

If non-zero, then the --hide-completed-todos option was supplied on the command line. That's it, that's the whole vibe check ๐Ÿ”.


$HushMode (read-only)

If non-zero, then the -h option was supplied on the command line.


$IgnoreOnce (read-only)

If non-zero, then the -o option was supplied on the command line, or it got implicitly enabled for some other reason. In this case, ONCE directives will be ignored. ๐Ÿ™ˆ


$InfDelta (read-only)

If non-zero, then the -t option was supplied on the command line, with no n argument.


$IntMax (read-only)

The largest representable INT. On a machine with 32-bit signed integers using twos-complement representation, this will be 2147483647. Big number energy ๐Ÿ‘‘


$IntMin (read-only)

The smallest representable INT. On a machine with 32-bit signed integers using twos-complement representation, this will be -2147483648. Same energy, opposite direction ๐Ÿ•ณ๏ธ


$Latitude (STRING type)

The latitude of your location, expressed as a string that is a floating-point number. Because Remind does not have a native floating-point type, we gotta express it as a string. No cap. ๐Ÿ˜ญ

$Latitude can range from "-90.0" to "90.0", with positive numbers representing points north of the equator and negative numbers representing south.

Note that regardless of your locale, $Latitude is always interpreted in the "C" locale and as such, the decimal point must be a period ("."). Not a comma. The period. ๐ŸŽฏ

$Longitude (STRING type)

The longitude of your location, expressed as a string that is a floating-point number. Again โ€” no native floating-point type in Remind, so string it is.

$Longitude can range from "-180.0" to "180.0", with positive numbers representing points east of the Greenwich Meridian and negative numbers representing west.

Same rule as latitude bestie: regardless of your locale, $Longitude is always interpreted in the "C" locale and as such, the decimal point must be a period (".").

For example, the coordinates of the CN Tower in Toronto, ON, Canada are approximately set by:

SET $Latitude   "43.6424247"
SET $Longitude "-79.3875153"

$LatDeg, $LatMin, $LatSec (DEPRECATED)

These specify the latitude of your location. $LatDeg can range from -90 to 90, and the others from -59 to 59. Northern latitudes are positive; southern ones are negative. For southern latitudes, all three components should be negative.

๐Ÿšจ These three variables are deprecated โ€” you should use $Latitude instead. It's giving legacy code. Move on, bestie.

$Location (STRING type)

A string specifying the name of your location. Usually the name of your town or city. Set it to whatever you like, but good style indicates that it should be kept consistent with the latitude and longitude system variables. Aesthetic matters โœจ


$LongDeg, $LongMin, $LongSec (DEPRECATED)

These specify the longitude of your location. $LongDeg can range from -180 to 180. Western longitudes are positive; eastern ones are negative.

โš ๏ธ Note that all three components should have the same sign: all positive for western longitudes and all negative for eastern longitudes.
โš ๏ธ And note that for historical reasons, the sign for longitude is different from the usual convention! If you find the longitude of your location from a search engine, you will most likely need to invert the sign to have it work correctly with Remind. Yes really. ๐Ÿ˜ญ

These three variables are deprecated; you should use $Longitude instead. Note also that $Longitude uses the standard convention of negative for western longitudes and positive for eastern ones.

The latitude and longitude information is required for the functions sunrise() and sunset(). Default values can be compiled into Remind, or you can SET the correct values at the start of your reminder scripts.

๐Ÿ”„ Note that setting any of $LongDec, $LongMin and $LongSec updates $Longitude correspondingly, and setting $Longitude updates $LongDeg, $LongMin and $LongSec. Similar rules apply to $Latitude, $LatDeg, $LatMin and $LatSec. They stay in sync, it's giving teamwork ๐Ÿซถ

$JSONMode (read-only)

If non-zero, then the --json command-line option was supplied.


$MaxLateMinutes

This variable controls how Remind reacts to a computer being suspended and then woken. Normally, if a timed reminder is queued and then the computer suspended, and then the computer is woken after the timed reminder's trigger time, Remind will trigger the timer anyway โ€” despite the fact that the trigger time has already passed. ๐Ÿ˜ดโžก๏ธโฐ

But if you set $MaxLateMinutes to a non-zero integer between 1 and 1440, then Remind will not trigger a timed reminder whose trigger time is more than $MaxLateMinutes minutes in the past. Expired is expired, bestie.

๐Ÿ“Œ Note that Remind uses the value of $MaxLateMinutes that is in effect when it has finished reading the reminder file and puts itself in the background. Generally, you should set $MaxLateMinutes once near the beginning of the file and not change it after that.

$MaxSatIter

The maximum number of iterations for the SATISFY clause (described later). Must be at least 10. The default value is 10,000. Don't let it loop forever, it's not the moment ๐Ÿ’€


$MaxStringLen

A limit on the longest string that Remind will allow you to create. The default is 65535.

If you set $MaxStringLen to 0 or to -1, then remind will allow you to create arbitrarily-long strings, at least until it runs out of memory.

๐Ÿšจ We do not recommend setting $MaxStringLen to 0 or -1 because it is very easy to write code that DOSes Remind in that case. Do not do this. Please. ๐Ÿ™

$MinsFromUTC

The number of minutes between Universal Time Coordinated and local time. If $CalcUTC is non-zero, this is calculated upon startup of Remind. Otherwise, you must set it explicitly.

If $CalcUTC is zero, then $MinsFromUTC is used in the astronomical calculations. You must adjust it for daylight saving time yourself. โฐ

Also, if you want to initialize $MinsFromUTC using the -i command-line option, you must also set $CalcUTC to 0 with the -i option. Two-for-one deal.


$NextMode (read-only)

If non-zero, then the -n option was supplied on the command line.


$MaxFullOmits (read-only)

The maximum number of full OMITs allowed (a compiled-in constant).


$MaxIncludeCmdLines

The maximum number of lines Remind will read from an INCLUDECMD command. If this is exceeded, an error is reported. The default value is 10000. If set to zero, then Remind imposes no limit. โˆž vibes


$MaxCachedLines

In Calendar Mode, Remind will cache files in memory. However, if a given file is longer than $MaxCachedLines, then it will not be cached, but instead re-read from disk each time.

The default value of $MaxCachedLines is 1000000 (1 million). Yeah. A million.


$MaxLineLength

The maximum length in bytes of an input line, including all continuations.

๐Ÿšจ Note that if a line exceeds this length, Remind prints an error message and exits immediately. Like, immediately.

The default value is 10485760, equivalent to 10MB. If set to zero, then Remind imposes no limit on the length of an input line.


$MaxPartialOmits (read-only)

The maximum number of partial OMITs allowed (a compiled-in constant).


$NumFullOmits (read-only)

The number of full OMITs in the current OMIT context.


$NumPartialOmits (read-only)

The number of partial OMITs in the current OMIT context.


$NumQueued (read-only)

Contains the number of reminders queued so far for background timed triggering. It's the count of what's waiting in the wings ๐ŸŽญ


$NumTrig (read-only)

Contains the number of reminders triggered for the current date.

One use for this variable is as follows: suppose you wish to shade in the box of a PostScript calendar whenever a holiday is triggered. You could save the value of $NumTrig in a regular variable prior to executing a block of holiday reminders. If the value of $NumTrig after the holiday block is greater than the saved value, then at least one holiday was triggered, and you can execute the command to shade in the calendar box. (See the section "Calendar Mode".) โœจ So satisfying.

๐Ÿ“Œ Note that $NumTrig is affected only by REM commands; triggers in IFTRIG commands do not affect it.
  • $OnceFile (STRING type) โ€” okay so if you set this to a non-empty string, Remind stops using the file's access date to figure out whether a ONCE-type reminder should run, and instead keeps a timestamp inside the file $OnceFile. That's way more reliable than leaning on the access date of your reminder file, ngl.

If $OnceFile doesn't exist yet, it gets created the first time a ONCE keyword is processed. The file must be writable by the current user. And heads up bestie: if you try to set $OnceFile after a ONCE reminder has already been processed, Remind will throw a warning and just ignore your attempt. ๐Ÿ’€

  • $ParseUntriggered โ€” a flag telling Remind whether it should fully parse REM statements that aren't triggered. 0 (the default) means skip parsing them, 1 means parse them.

Say we've got this REM statement:

REM 2020-01-01 MSG ["bad_expression" / 2]

If $ParseUntriggered is 1, Remind fully parses the line and hits you with a "Type mismatch" error even if the reminder isn't triggered. But if $ParseUntriggered is 0 โ€” the default โ€” Remind won't error out until 2020-01-01, when the reminder actually triggers.

Keeping $ParseUntriggered at 0 may slightly improve performance, at the risk of not catching errors until a reminder fires. We recommend leaving it at 0.

  • $PrefixLineNo (read-only) โ€” if it's non-zero, then the -l option was supplied on the command line.
  • $PSCal (read-only) โ€” if it's non-zero, then the -p option was supplied on the command line.
  • $Repeat (read-only) โ€” if this variable holds a non-zero value n, then a command-line argument of *n was supplied to specify repeated runs of Remind.
  • $RunOff (read-only) โ€” if non-zero, the RUN directives are disabled.
  • $Shaded (read-only) โ€” returns the number of times a SHADE special reminder has triggered. โœจ This one is set only in Calendar Mode, not Agenda Mode. You can use it to avoid shading a calendar day that's already been shaded.

Example time: say you wanna shade every calendar box yellow if any reminders triggered that day, but if a box was explicitly shaded you don't wanna overwrite it. You could do something like:

SET n $NumTrig
# Do all your reminders here...

# If anything has triggered and the box is
# not already shaded, then shade it yellow
IF $NumTrig > n && !$Shaded
    REM SPECIAL SHADE 255 255 128
ENDIF
  • $SimpleCal (read-only) โ€” set to a non-zero value if either the -p or the -s command-line option was supplied.
  • $SortByDate (read-only) โ€” set to 0 if no -g option is used, 1 if sorting by date in ascending order, or 2 if sorting by date in descending order.
  • $SortByPrio (read-only) โ€” set to 0 if no -g option is used, 1 if sorting by priority in ascending order, or 2 if sorting by priority in descending order.
  • $SortByTime (read-only) โ€” set to 0 if no -g option is used, 1 if sorting by time in ascending order, or 2 if sorting by time in descending order.
  • $SubsIndent โ€” the number of spaces that all lines (except the first) of an MSF-type reminder should be indented by. Default is 0.
  • $SuppressImplicitWarnings โ€” normally Remind warns you if a line starts with an unknown token and gets treated as a REM command, or if a REM command is missing a type and gets treated as a MSG-type reminder. Setting $SuppressImplicitWarnings to 1 shuts those warnings up. Default is 0, and we do not recommend disabling the warnings.
  • $SuppressLRM โ€” normally, when Remind runs with the -c option in a UTF-8 locale, it emits a left-to-right mark sequence after printing day names or reminders. Some terminals render this wrong, so you can use:
SET $SuppressLRM 1

at the top of your reminder file to suppress the LRM sequences, or you can invoke Remind with the option -i$SuppressLRM=1.

  • $SysInclude (read-only, STRING type) โ€” a directory path holding standard reminder scripts. Currently Remind ships with some standard holiday files and language packs. On this installation, the value of $SysInclude is /usr/share/remind.
  • $T (read-only, DATE or INT type) โ€” equivalent to trigdate(). (See BUILT-IN FUNCTIONS.)
  • $Tb (read-only, DATE or INT type) โ€” equivalent to trigbase().
  • $Td (read-only) โ€” equivalent to day(trigdate()).
  • $Tm (read-only) โ€” equivalent to monnum(trigdate()).
  • $Tu (read-only, DATE or INT type) โ€” equivalent to triguntil().
  • $Tw (read-only) โ€” equivalent to wkdaynum(trigdate()).
  • $Ty (read-only) โ€” equivalent to year(trigdate()).
  • $Tt (read-only, TIME or INT type) โ€” equivalent to trigtime().
  • $TimeSep (STRING type) โ€” you can only set this to ":" or ".". It holds the character used to separate the parts of a time when Remind prints a TIME or DATETIME value.
  • $TimetIs64bit (read-only) โ€” returns 1 if the internal C time_t type is at least 64 bits long. If it returns 0, then the internal C library can't represent dates after about 2038, and Remind will use a workaround to dodge problems. Also see the section "MACHINES WITH A 32-BIT TIME_T TYPE".
  • $TodoFilter (read-only) โ€” if 0, then both events and TODOs are being output. If 1, then the --only-todos command-line option was supplied. If 2, then the --only-events command-line option was supplied.
  • $UntimedFirst (read-only) โ€” set to 1 if the -g option is used with a fourth sort character of "d"; set to 0 otherwise.
  • $U (read-only, DATE type) โ€” exactly equivalent to today(). (See BUILT-IN FUNCTIONS.)
  • $Ud (read-only) โ€” equivalent to day(today()).
  • $Um (read-only) โ€” equivalent to monnum(today()).
  • $Uw (read-only) โ€” equivalent to wkdaynum(today()).
  • $Uy (read-only) โ€” equivalent to year(today()).
  • $UseVTColors (read-only) โ€” set to 1 if the -@ or -cc options were used; 0 otherwise.
  • $UseBGVTColors (read-only) โ€” set to 1 if the -@,,1 option was used; 0 otherwise.
  • $Use256Colors (read-only) โ€” set to 1 if the -@1 option was used; 0 otherwise.
  • $UseTrueColors (read-only) โ€” set to 1 if the -@2 option was used; 0 otherwise.
  • $TerminalBackground (read-only) โ€” returns -1 if the terminal background color couldn't be determined, 0 if it was found to be dark (or was specified as dark with the -@,0 option), or 1 if it was found to be light (or specified as light with the -@,1 option). The terminal background counts as "dark" if the average of the red, green and blue components is at most 85 out of 255, and if the maximum of any component is at most 128 out of 255. ๐ŸŽจ
  • $TerminalHyperlinks (INT type) โ€” if your terminal supports escape sequences that let you wrap HTML-like anchors around text (see https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda), then you can set this variable to 1. Remind will then turn any reminder with a "Url:" info string into a hyperlink in your terminal. ๐Ÿ”— By default, $TerminalHyperlinks is set to 1 if Remind's standard output is a terminal, or 0 if it's not.
  • $WarningLevel (STRING type) โ€” as new versions of Remind drop, new warnings may get added. So if your formerly-fine scripts suddenly start spitting warnings when you upgrade Remind, then as a stopgap measure you can set $WarningLevel to a string of the form AB.CD.EF, where AB, CD and EF are pairs of decimal digits. That suppresses any warnings introduced after Remind version AB.CD.EF. If you don't set $WarningLevel, it defaults to the current version of Remind, meaning all warnings get issued.

For example, if you want your warnings limited to what Remind 05.00.00 would have produced, use:

SET $WarningLevel "05.00.00"

We do not recommend setting $WarningLevel as a matter of course; you should use it to suppress warnings only for as long as it takes you to fix your remind scripts so they stop causing warnings to be emitted.

Note: if any of the Calendar Modes are in effect, then the values of $Daemon, $DontFork, $DontTrigAts, $DontQueue, $HushMode, $IgnoreOnce, $InfDelta, and $NextMode are not meaningful.

๐ŸŽ€ SAVING AND RESTORING VARIABLES ๐ŸŽ€

Just like with the OMIT context, you can save and restore the values of global variables and all the (modifiable) system variables. For example:

SET a 1
UNSET b

# Save variables
PUSH-VARS $DefaultColor $AddBlankLines a b

SET $DefaultColor "255 0 0"
SET $AddBlankLines 0
SET a 3
SET b 4
REM MSG Hello

# Restore all the variables we pushed earlier
POP-VARS

# Now the changes to $DefaultColor and $AddBlankLines
# have been undone.  Additionally, a is restored to 1
# and b is unset

As you can see from the example, PUSH-VARS takes a list of global variable names and/or system variable names. You can save the values of any modifiable system variables and any global variable. You can even push global variables that aren't set. โœจ

The POP-VARS command restores the values of all system variables and global variables that were pushed by the most recent PUSH-VARS command. And if you push an undefined global variable, then that variable gets unset by the POP-VARS command. ๐Ÿ’…


๐Ÿ‘‘ BUILT-IN FUNCTIONS ๐Ÿ‘‘

Remind has a plethora of built-in functions. The syntax for a function call is the same as in C โ€” the function name, followed by a comma-separated list of arguments in parentheses. Function names are not case-sensitive. If a function takes no arguments, it must be followed by "()" in the function call. Otherwise, Remind will interpret it as a variable name, and it probably won't work correctly. ๐Ÿ™ˆ

Okay so before we get into the actual functions, decoder-ring moment ๐Ÿ’ซ โ€” in the descriptions below, short forms are used to denote acceptable types for the arguments. The characters "i", "s", "d", "t" and "q" stand for INT, STRING, DATE, TIME and DATETIME arguments, respectively. If an argument can be one of several types, the characters just get smooshed together. So like, "di_arg" means that argument can be a DATE or an INT. And "x_arg" means bestie can be literally any type. The type is followed by an underscore and an identifier naming the argument. Heads up though: in the actual explanation of each function (the part that comes after the argument description), those type prefixes get dropped when we refer to the arguments. iykyk ๐ŸŒธ

The built-in functions are:

_(s_message)

Returns the translation table entry for message. If there's no such translation table entry, it just hands message back to you unmodified. Like, consider this sequence:

TRANSLATE "Goodbye" "Tot ziens"
SET a _("Goodbye")

After those two lines have been executed, the variable a will be set to "Tot ziens". See the section THE TRANSLATION TABLE for more info. ๐Ÿฆ‹

In the body of a reminder, the substitution sequence %(text) is (almost) the equivalent of [_("text")]. So these two reminders are almost equivalent:

REM MSG %(Goodbye)
REM MSG [_("Goodbye")]

The only difference? If _("Goodbye") contains a % sign, then that result will get run through the substitution filter, whereas in the first reminder it won't. That's because the second REM command does expression pasting followed by a substitution filter pass, while the first one does the translation as part of the substitution filter (and does not make a second substitution filter pass). Sneaky, right? ๐Ÿ’…

abs(i_num)

Returns the absolute value of num. Simple. Clean. Slay. โœจ

access(s_file, si_mode)

Tests the access permissions for the file file. Mode can be a string containing a mix of the characters "rwx" for read, write and execute permission testing. Alternatively, mode can be a number as described in the UNIX access(2) system call. The function returns 0 if the file can be accessed with the specified mode, and -1 otherwise. ๐ŸŽ€

adawn([dq_date])

Returns the time of "astronomical dawn" on the specified date. If date is omitted, it defaults to today(). And if a datetime object is supplied, only the date component gets used. ๐ŸŒ…

adusk([dq_date])

Returns the time of "astronomical twilight" on the specified date. If date is omitted, defaults to today(). ๐ŸŒ†

ampm(tq_time [,s_am [,s_pm [,i_lz]]])

Returns a STRING that's the result of converting time (which is either a TIME or a DATETIME object) to "AM/PM" format. The optional arguments am and pm are the strings to append in the AM and PM case respectively; they default to "AM" and "PM". The optional argument lz specifies whether or not the hour should be padded to two digits with a leading zero. If lz is zero, then a leading 0 is not added; otherwise, the hour gets padded out to two digits with a leading zero. If not supplied, lz defaults to zero.

The function obeys the system variables $DateSep, $TimeSep and $DateTimeSep when formatting its output. Here are some examples of its output:

ampm(0:22)                 returns "12:22AM"
ampm(17:45, "am", "pm")    returns "5:45pm"
ampm(17:45, "am", "pm", 1) returns "05:45pm"
ampm('2020-03-14@21:34')   returns "2020-03-14@9:34PM"

ansicolor(i_red, i_green, i_blue [,i_bg [,i_clamp]])

Returns a STRING containing an ANSI escape sequence for changing the terminal text color ๐ŸŒˆ. The parameters red, green and blue are integers from 0 to 255 specifying the value of the respective color component. Special case alert: all three values can be -1, in which case the ANSI sequence "ESC[0m" is returned, which resets all text attributes to normal.

The string returned by ansicolor depends on the color mode that Remind is running in, as specified by the -@ option. If color mode is not enabled, then ansicolor always returns the empty string. Otherwise, it returns the escape sequence that best approximates the color according to the -@ color mode. ๐ŸŽจ

The optional bg argument is either 0 or 1. If 0 (the default), then the foreground color is set. If 1, then the background color is set. Note that setting the background color only works in 256-color or true-color mode. ๐Ÿ‘€

The optional clamp argument is either 0 or 1. If 0 (the default), then colors are not adjusted based on the terminal background color. If 1, then Remind attempts to adjust dark or bright colors so they have enough contrast to be visible in the terminal.

The first three arguments may alternatively be specified as a string consisting of three space-separated numbers, as in this example: "128 128 0"

As a special case, ansicolor("") is equivalent to ansicolor(-1,-1,-1) and returns the ANSI sequence to reset all text attributes to normal.

Note that inserting ANSI color sequences in Calendar Mode will produce garbled results. ๐Ÿ’€ Therefore, we recommend defining functions such as the ones below that return the empty string in Calendar Mode:
IF $CalMode
    FSET fg(r,g,b) ""
    FSET bg(r,g,b) ""
ELSE
    FSET fg(r,g,b) ansicolor(r,g,b)
    FSET bg(r,g,b) ansicolor(r,g,b,1)
ENDIF
REM [fg(255,0,0)][bg(64,64,64)]Red on Gray[fg(-1,-1,-1)] in Agenda Mode
REM SPECIAL COLOR 0 255 0 Green in Agenda and Calendar Mode

If you use the ansicolor function, don't forget to reset the color back to normal with ansicolor(-1,-1,-1) or subsequent reminders will continue to be colored. No cap, that's the classic oopsie. ๐Ÿ™ˆ

args(s_fname)

Returns the number of arguments expected by the user-defined function fname, or -1 if no such user-defined function exists. Note that this function examines only user-defined functions, not built-in functions. Its main use is to determine whether or not a particular user-defined function has been defined previously. The args() function is available only in versions of Remind from 03.00.04 and up. โญ

asc(s_string)

Returns an INT that's the ASCII code of the first byte in string. As a special case, asc("") returns 0. For UTF-8 strings, this will return the UTF-8 byte with which the string begins, which is not likely to be very useful. ๐Ÿ˜ญ

codepoint(s_string)

Returns an INT that's the code point of the first character in string, treating multi-byte characters correctly. As a special case, codepoint("") returns 0. This one's the glow-up version of asc bestie, use it. ๐Ÿ’–

baseyr()

Returns the "base year" that was compiled into Remind (normally 1990.) All dates are stored internally as the number of days since 1 January of baseyr(). ๐Ÿ—“๏ธ

catch(x_arg1, x_arg2)

Evaluates arg1 and if no error occurs, returns the resulting value. If an error occurs during the evaluation of arg1, evaluates and returns arg2. Note that catch() can only catch run-time evaluation errors. It cannot catch syntax errors.

Here are some examples:

catch(4/2, 33)  => 2, because 4/2 evaluates without error
catch(4/0, 33)  => 33, because 4/0 gives a divide-by-zero error
catch(2, 1/0)   => 2, and the second argument is not evaluated
catch(4/0, 1/0) results in a divide-by-zero error

Note in that last example that catch does not protect you from errors in the evaluation of arg2. ๐Ÿซ 

catcherr()

Returns a string representing the error message from the most recently-evaluated catch() function whose first argument yielded an error. Note that the error message is always in English even if Remind has been localized; this lets you reliably test the return value. Here are some examples:

# No "catch" invocations yet:  sets a to "Ok"
set a catcherr()

# Sets b to "oops" and a to "Division by zero"
set b catch(1/0, "oops")
set a catcherr()

# Sets b to 1 and a to "Division by zero".  The catch error
# is never cleared by a non-error catch()
set b catch(4-3, "not-evaluated")
set a catcherr()

char(i_i1 [,i_i2...])

This function can take any number of INT arguments. It returns a STRING consisting of the bytes specified by the arguments. It is easy to create invalid UTF-8 sequences; char does not check for this. ๐Ÿ’€ Note that none of the arguments can be 0, unless there is only one argument. As a special case, char(0) returns "".

mbchar(i_i1 [,i_i2...])

This function can take any number of INT arguments. It returns a STRING consisting of the characters specified by the arguments. Any codepoint may be supplied and a correct multi-byte character string will be returned. Note that none of the arguments can be 0, unless there is only one argument. As a special case, mbchar(0) returns "". Additionally, no argument may be a negative number. ๐Ÿงš

choose(i_index, x_arg1 [,x_arg2...])

choose must take at least two arguments, the first of which is an INT. If index is n, then the nth subsequent argument is returned. If index is less than 1, then arg1 is returned. If index is greater than the number of subsequent arguments, then the last argument is returned. Examples:

choose(0, "foo", 1:13, 1000) returns "foo"
choose(1, "foo", 1:13, 1000) returns "foo"
choose(2, "foo", 1:13, 1000) returns 1:13
choose(3, "foo", 1:13, 1000) returns 1000
choose(4, "foo", 1:13, 1000) returns 1000

Note that only the first argument and the chosen result are evaluated. Any non-chosen arguments will not be evaluated. Efficient queen behavior honestly ๐Ÿ‘‘

coerce(s_type, x_arg)

This function converts arg to the specified type, if such conversion is possible. Type must be one of "INT", "STRING", "DATE", "TIME" or "DATETIME" (case-insensitive). The conversion rules are as follows:

If <i>arg</i> is already the type you asked for, bestie, it just comes right back to you unchanged. No drama, no conversion, we love a no-op. โœจ

If <i>type</i> is "STRING", then <i>arg</i> gets turned into a string that's literally its printed representation. Whatever it looked like when printed, that's your string now.

If <i>type</i> is "DATE", then an INT <i>arg</i> gets converted by reading it as the number of days since 1 January baseyr(). A STRING <i>arg</i> gets converted by trying to read it like it was a printed date. A DATETIME gets converted to a date by <b>dropping the time component</b> โ€” bye time, didn't need you. And a TIME <i>arg</i>? Cannot be converted to a date. Nope. Not happening.

If <i>type</i> is "TIME", then an INT <i>arg</i> gets converted by reading it as the number of minutes since midnight. A STRING <i>arg</i> gets converted by trying to read it like a printed time. A DATETIME gets converted to a time by <b>dropping the date component</b>. And a DATE <i>arg</i>? Cannot be converted to a time. Sorry babe.

If <i>type</i> is "DATETIME", then an INT <i>arg</i> gets converted by reading it as the number of minutes since midnight, 1 January baseyr(). A STRING gets converted by trying to read it like a printed datetime. Any other type cannot be converted to a datetime โ€” that door is locked. ๐Ÿ”’

If <i>type</i> is "INT", then DATE, TIME and DATETIME arguments get converted using <b>the reverse of the procedures described above</b>. A STRING <i>arg</i> gets converted by parsing it as an integer.


๐Ÿ’… columns([s_arg])

Okay so if you call it with <b>no arguments</b>, columns() does this whole thing: if either standard output <i>or</i> standard error is a TTY, it returns the width of the terminal in columns. If <b>neither</b> standard output nor standard error is a TTY, it tries to open "/dev/tty" to get the terminal size. And if <i>that</i> fails? It returns -1. It's giving "I tried my best." ๐Ÿ˜ญ

If you call it with a <b>single string argument</b>, columns(str) returns the number of columns <i>str</i> will take up when printed to a terminal. ANSI color-changing sequences occupy <b>zero</b> columns, whereas some Unicode characters occupy <b>two</b>. columns(str) takes all of that into account. Note that if Remind was compiled without Unicode support, columns(str) returns a type mismatch error.

The result of columns(str) may be <b>less than, equal to, or greater than</b> the result of mbstrlen(str). Why? Because some Unicode characters are the so-called combining characters that add one to the character length but don't occupy any columns on their own. And other Unicode characters are double-width characters that add one to the character length, but <b>two</b> to the number of display columns. The math is mathing differently, and that's valid. ๐Ÿฆ‹

๐Ÿ’œ const(x_arg)

Evaluates <i>arg</i> and hands it back to you, but also makes sure the result is marked "constant".

โš ๏ธ Use with caution; incorrect use could result in unwanted reminders being purged in Purge Mode. Like, that's real. Be careful.

See also the section "NON-CONSTANT EXPRESSIONS".

โฐ current()

Returns the current date and time as a DATETIME object. And here's the tea: this may be the <b>actual</b> date and time, or it may be the date and time supplied <b>on the command line</b>. Either way, she's serving.

๐ŸŒธ date(i_y, si_m, i_d)

The date() function returns a DATE object with the year, month and day components you specify with <i>y</i>, <i>m</i> and <i>d</i>. The month can be an integer from 1 to 12, or a string that's the name of a month. Flexible queen. โœจ

๐ŸŽ€ datepart(dq_datetime)

Returns a DATE object representing just the <b>date portion</b> of <i>datetime</i>. Time part? Gone. We don't know her.

๐Ÿ•ฐ๏ธ datetime(args)

The datetime() function can take anywhere from <b>two to five</b> arguments. It always returns a DATETIME generated from its arguments. Let's break it down, bestie:

  • If you supply <b>two arguments</b>, the first <b>must be a DATE</b> and the second <b>a TIME</b>.
  • If you supply <b>three arguments</b>, the first <b>must be a DATE</b> and the second and third <b>must be INTs</b>. Those second and third arguments get interpreted as hours and minutes and converted to a TIME.
  • If you supply <b>four arguments</b>, they're interpreted as year, month, day and time. Year and day <b>must be INTs</b>. Month may be an INT from 0 to 12 or a string naming a month. Time <b>must be a TIME</b>.
  • And finally, if you supply <b>five arguments</b>, they must <b>all be INTs</b> and are interpreted as year, month, day, hour and minute. (Actually, month can also be a string that's the name of a month. Sneaky little exception, we stan.)

๐ŸŒ… dawn([dq_date])

Returns the time of "civil dawn" on the specified date. If <i>date</i> is omitted, it defaults to today(). If you hand it a datetime object, only the date component gets used. Golden hour but make it computational. ๐ŸŒž

๐Ÿ“… day(dq_date)

This function takes a DATE or DATETIME as an argument and returns an INT that is the <b>day-of-month component</b> of <i>date</i>.

๐Ÿ—“๏ธ daysinmon(si_m, i_y) or daysinmon(dq_date)

Returns the number of days in month <i>m</i> (1-12) of the year <i>y</i>. The first argument can either be an integer from 1 to 12, or a string that's the name of a month. And if you give it a <b>single DATE or DATETIME</b> argument, it returns the number of days in the month containing that argument. Iconic range. ๐Ÿ’–

๐Ÿ” defined(s_var)

Returns 1 if the variable named by <i>var</i> is defined, or 0 if it's not.

Now listen, note that defined() takes a STRING argument; so to check if variable X is defined, you use:

defined("X")

and <b>not</b>:

defined(X)

The second example will try to evaluate X, and will return an error if it's undefined or not of type STRING. The quotes are doing the heavy lifting, fr fr. ๐Ÿ’…

๐Ÿ” dosubst(s_str [,d_date [,t_time]]) or dosubst(s_str [,q_datetime])

Returns a STRING that's the result of passing <i>str</i> through the substitution filter described earlier. The parameters <i>date</i> and <i>time</i> (or <i>datetime</i>) establish the effective trigger date and time used by the substitution filter. If <i>date</i> and <i>time</i> are omitted, they default to today() and now().

Note that if <i>str</i> does not end with "%", a newline character will be added to the end of the result. Also, calling dosubst() with a date that is in the past (i.e., if <i>date</i> < today()) will produce undefined results. Don't do that. Seriously. ๐Ÿšซ

Dosubst() is only available starting from version 03.00.04 of Remind. So if you're on something older, bestie, it's giving "not for you."

๐ŸŒ† dusk([dq_date])

Returns the time of "civil twilight" on the specified date. If <i>date</i> is omitted, it defaults to today(). The vibe shift hour. ๐ŸŒ™

๐Ÿฃ easterdate([dqi_arg])

If <i>arg</i> is an INT, then it returns the date of Easter Sunday for the specified year. If <i>arg</i> is a DATE or DATETIME, then it returns the date of the <b>next Easter Sunday on or after</b> <i>arg</i>. (The time component of a datetime is ignored โ€” she's not interested.) If <i>arg</i> is omitted, then it defaults to today().

Note that easterdate computes the <b>Western Easter</b>. For the Orthodox Easter date, see orthodoxeaster. Different queen, different calendar. โœจ

๐Ÿช„ escape(s_string [,i_add_quotes])

Returns a STRING that's the same as the input string, but with <b>all special characters backslashed-escaped</b>. For example, this command:

set a escape("foo" + char(10) + "bar")

will set <i>a</i> to "foo\nbar" where "\n" is the literal sequence "\" followed by "n". This is useful if you want to compute a string in a pasted-in expression that Remind will then parse as a quoted string <b>again</b>, such as in a TRANSLATE command or an INFO clause. Escaping: the ultimate double-back. ๐Ÿ’ซ

If the optional <i>add_quotes</i> argument is supplied and is non-zero, then the return value from escape will include surrounding double-quotes. Cute.

๐Ÿงฎ eval(s_arg)

Parses the string <i>arg</i> as an expression and evaluates it, returning the result. Note that any variable names in the parsed expression refer to <b>global variables</b>, not any local variables. For example, consider this:

SET x 2
FSET f(x) x + eval("1 + x")
REM MSG F is [f(9)]

The result will be "F is 12" because the reference to x inside the eval() argument refers to the <b>global</b> variable x and <b>not</b> the function argument. Scope said "not today." ๐Ÿ˜ญ

Note that for safety, RUN is disabled during the evaluation of eval(), which means you can't use the shell() function from within an eval(). Sorry, no sneaky shell access in there. ๐Ÿ”’

๐Ÿ”ฎ evaltrig(s_trigger [,dq_start])

Evaluates <i>trigger</i> as if it were a REM or IFTRIG trigger specification and returns the trigger date as a DATE (or as a DATETIME if there's an AT clause). And if no trigger could be computed? It returns a <b>negative INT</b>. Sad girl math.

Normally, evaltrig finds a trigger date <b>on or after today</b>. If you supply the <i>start</i> argument, then it scans starting from there instead.

For example, this expression:

evaltrig("Mon 1", '2008-10-07')

returns '2008-11-03', since that's the first date on or after 7 October 2008 that satisfies "Mon 1". โœจ

And if you want to see how many days it is from the first Monday in October, 2008 to the first Monday in November, 2008, use:

evaltrig("Mon 1", '2008-11-01') - evaltrig("Mon 1", '2008-10-01')

and the answer is 28. Math queen. ๐Ÿ‘‘

The <i>trigger</i> argument to evaltrig can have all the usual trigger clauses (OMIT, AT, SKIP, etc.) but cannot have a SATISFY, MSG, etc. reminder-type clause. Triggers only, bestie.

๐Ÿ“‚ filedate(s_filename)

Returns the <b>modification date</b> of <i>filename</i>. If <i>filename</i> doesn't exist, or its modification date is before the year baseyr(), then 1 January of baseyr() is returned. Fallback date, but make it classic.

๐Ÿ• filedatetime(s_filename)

Returns the <b>modification date and time</b> of <i>filename</i>. If <i>filename</i> doesn't exist, or its modification date is before the year baseyr(), then midnight, 1 January of baseyr() is returned. Same energy, now with a timestamp. ๐Ÿ•›

๐Ÿ“ filedir()

Returns the directory that contains the <b>current file being processed</b>. It may be a relative or absolute pathname, but it's <b>guaranteed to be correct</b> for use in an INCLUDE command, like this:

INCLUDE [filedir()]/stuff

This includes the file "stuff" in the same directory as the current file being processed. Note that this workaround is no longer necessary because DO stuff will achieve the same goal. Legacy behavior, still cute though.

Note that if the currently-processing reminders file was specified as a symbolic link, then filedir() returns the directory containing the <b>symbolic link</b> and not the directory containing the <b>target</b> of the symbolic link. You should avoid using symbolic links to files unless both the symbolic link and its target happen to be in the same directory. Symlink drama, avoid it. ๐Ÿ™ˆ

๐Ÿท๏ธ filename()

Returns (as a STRING) the name of the current file being processed by Remind. Inside included files, it returns the name of the <b>included file</b>. She tells you where you are. ๐ŸŒˆ

  • getenv(s_envvar) โ€” bestie this is literally just the getenv(2) system call in a trench coat ๐Ÿ’… it hands you back a STRING that is the value of the environment variable you asked for. If that variable doesn't exist? You get "" โ€” an empty string, no drama. Heads up tho: environment variable names are generally case-sensitive, so getenv("HOME") is not the same as getenv("home"). Don't do that to yourself. ๐Ÿ™ˆ
  • hebdate(i_day, s_hebmon [,idq_yrstart [,i_jahr [,i_aflag]]]) โ€” Hebrew date support, babes! Go read the section "THE HEBREW CALENDAR" for the full tea. โœจ
  • hebday(dq_date) โ€” Hebrew date support again ๐Ÿ’– โ€” check "THE HEBREW CALENDAR".
  • hebmon(dq_date) โ€” yep, Hebrew dates ๐ŸŒธ โ€” see "THE HEBREW CALENDAR".
  • hebyear(dq_date) โ€” still Hebrew dates, still that section ๐Ÿ‘‘ โ€” "THE HEBREW CALENDAR".
  • hex(i_n) โ€” gives you back a STRING that's the hexadecimal version of n. No "0x" prefix (we don't do that here), and every letter in the result is uppper-case. Periodt. ๐Ÿ”ฅ
  • hour(tq_time) โ€” pulls out the hour component of time. Simple, iconic, does exactly what it says. โญ
  • htmlescape(s_str) โ€” returns a modified copy of str where "<" becomes "&lt;", ">" becomes "&gt;", and "&" becomes "&amp;". Escaping era fr fr ๐ŸŽ€
  • htmlstriptags(s_str) โ€” hands you a modified copy of str with the HTML tags ripped out ๐Ÿซถ the algorithm is fairly naive ngl: it starts stripping characters the second it hits a "<", and it stops the second it hits a ">". That's the whole strategy, bestie.
  • iif(x_test1, x_arg1, [x_test2, x_arg2,...], x_default) โ€” if test1 is true, you get arg1. Otherwise if test2 is true, you get arg2, and so on down the line. If every test is false, you get default. Big brain detail: only the arguments actually needed to figure out the final result get evaluated ๐Ÿ˜Œ and this function accepts an odd number of arguments โ€” but lowkey a lore drop: prior to version 03.00.05 of Remind, it accepted 3 arguments only. The 3-argument version of iif() is compatible with previous versions of Remind. ๐Ÿ’œ
  • index(s_search, s_target [,i_start) โ€” returns an INT that is the location of target in the string search. Careful tho โ€” index uses byte positions, not character positions, so do not use it on non-ASCII strings. Use mbindex for non-ASCII strings, bestie.

The first byte of a string is numbered 1. If target does not exist in search, then 0 is returned.

The optional parameter start specifies the position in search at which to start looking for target.

  • mbindex(s_search, s_target [,i_start]) โ€” like index() but it returns the character position instead of the byte position ๐Ÿฆ‹ also, start is interpreted as a 1-based character index rather than a byte index. Unicode girlies stay winning.
  • isany(arg1 [,arg2, ..., argN]); โ€” returns 1 if the first argument arg1 is equal to any of the subsequent arguments arg2 through argN; returns 0 otherwise. Also returns 0 if you call it with only one argument. ๐Ÿ™ƒ

As an example, the following two expressions are equivalent:

        (a == b) || (a == c) || (a == d) || (a == e)

        isany(a, b, c, d, e)
  • isconst(x_any) โ€” evaluates its argument and then throws away the value ๐Ÿ’€ returning 1 if the expression is constant or 0 if it is non-constant. Note that isconst does not take into account the context; if arg is a constant expression but evaluated in a non-constant context, isconst will still return 1. For details about constant vs. non-constant expressions, see the section "NON-CONSTANT EXPRESSIONS".
  • isdst([d_date [,t_time]]) or isdst(q_datetime) โ€” returns a positive number if daylight saving time is in effect on the specified date and time ๐ŸŒˆ Date defaults to today() and time defaults to midnight.

Note that this function is only as reliable as the C run-time library functions. It is available starting with version 03.00.07 of Remind.

  • isleap(idq_arg) โ€” returns 1 if arg is a leap year, and 0 otherwise. Arg can be an INT, DATE or DATETIME object. If a DATE or DATETIME is supplied, then the year component is used in the test. โœจ
  • isomitted(dq_date) โ€” returns 1 if date is omitted, given the current global OMIT context. Returns 0 otherwise. (If a datetime is supplied, only the date part is used.) Note that any local OMIT or OMITFUNC clauses are not taken into account by this function. ๐Ÿ™ˆ
  • join([x_arg1 [,x_arg2...]]) โ€” the join function takes any number of arguments of any type ๐Ÿ’… it converts them all to STRING, concatenates them, and returns the resulting string. Calling join() with no arguments yields the empty string.
  • language() โ€” returns a STRING naming the compiled-in language supported by Remind. Okay history lesson: Remind used to support compiled-in support for other languages, but now all localization is done at run-time. As such, this function always returns "English". However โ€” plot twist โ€” the expression _("LANGID") returns the two-character ISO 639 language code of any language pack in effect, assuming the language pack author has written the localization correctly! ๐Ÿ‘‘
  • localtoutc(q_datetime) โ€” given a DATETIME object interpreted in the local time zone, return a DATETIME object that expresses the same time in UTC. Timezone glow-up ๐Ÿฆ‹
  • lower(s_string) โ€” returns a STRING with all upper-case bytes in string converted to lower-case. Note: this function works correctly only for ASCII strings. If you're using Unicode characters outside the ASCII set, use mblower instead.
  • mblower(s_string) โ€” returns a STRING with all upper-case characters in string converted to lower-case. This function works correctly on any Unicode string. ๐ŸŒธ
  • max(x_arg1 [,x_arg2...) โ€” can take any number of arguments, and returns the maximum. The arguments can be of any type, but must all be of the same type. They are compared as with the > operator. ๐Ÿ”ฅ
  • min(x_arg1 [,x_arg2...) โ€” can take any number of arguments, and returns the minimum. The arguments can be of any type, but must all be of the same type. They are compared as with the < operator. ๐Ÿ’œ
  • minsfromutc([d_date [,t_time]]) or minsfromutc(q_datetime) โ€” returns the number of minutes from Universal Time Coordinated (formerly GMT) to local time on the specified date and time โญ Date defaults to today() and time defaults to midnight. If local time is before UTC, the result is negative. Otherwise, the result is positive.

Note that this function is only as reliable as the C run-time library functions. It is available starting with version 03.00.07 of Remind.

  • minute(tq_time) โ€” returns the minute component of time. ๐ŸŽ€
  • mon(dqis_arg) โ€” if arg is of DATE or DATETIME type, returns a string that names the month component of the date. If arg is an INT from 1 to 12, returns a string that names the month. If arg is a STRING, returns the name of the month. This last case might sound silly, but for example:
                     mon("Mar")

will return "March", the full name of the month. Glow-up fr fr โœจ

  • monnum(dq_date) or monnum(s_str) โ€” returns an INT from 1 to 12, representing the month component of date. If a STRING is supplied rather than a DATE or DATETIME, then if str is a valid month name (or minimum 3-character abbreviation of a month name) then the corresponding month number is returned. If str is not a valid month name, then an error occurs. ๐Ÿ˜ญ
  • moondate(i_phase [,d_date [,t_time]]) or moondate(i_phase, q_datetime) โ€” this function returns the date of the first occurrence of the phase phase of the moon on or after date and time ๐ŸŒ™ Phase can range from 0 to 3, with 0 signifying new moon, 1 first quarter, 2 full moon, and 3 third quarter. If date is omitted, it defaults to today(). If time is omitted, it defaults to midnight.

For example, the following returns the date of the next full moon:

                      SET fullmoon moondate(2)
  • moontime(i_phase [,d_date [,t_time]]) or moontime(i_phase, q_datetime) โ€” this function returns the time of the first occurrence of the phase phase of the moon on or after date and time ๐ŸŒ™ Phase can range from 0 to 3, with 0 signifying new moon, 1 first quarter, 2 full moon, and 3 third quarter. If date is omitted, it defaults to today(). If time is omitted, it defaults to midnight. Moontime() is intended to be used in conjunction with moondate(). The moondate() and moontime() functions are accurate to within a couple of minutes of the times in "Old Farmer's Almanac" for Ottawa, Ontario. ๐Ÿ‘‘

For example, the following returns the date and time of the next full moon:

                      MSG Next full moon at [moontime(2)] on [moondate(2)]
  • moondatetime(i_phase [,d_date [,t_time]]) or moondatetime(i_phase, q_datetime) โ€” this function is similar to moondate and moontime, but returns a DATETIME result. Two birds, one icon ๐Ÿ’…
  • moonphase([d_date [,t_time]]) or moonphase(q_datetime) โ€” this function returns the phase of the moon on date and time, which default to today() and midnight, respectively. The returned value is an integer from 0 to 359, representing the phase of the moon in degrees ๐ŸŒˆ 0 is a new moon, 180 is a full moon, 90 is first-quarter, etc. Math girlie moment.
  • moonrise([d_date]) โ€” this function returns a DATETIME result giving the date and time of the first moonrise on or after midnight on date. If date is not supplied, it defaults to today(). ๐ŸŒ™

Note that it is not uncommon for a day to have no moonrise, so the date part of the return value may not be the same as the date argument. So if you want a calendar of moonrise times, you could use something like this:

                SET mr moonrise()
                IF datepart(mr) == today()
                    REM NOQUEUE [mr] MSG Moon rises at %3.
                ELSE
                    REM MSG No moonrise today
                ENDIF
  • moonrisedir([d_date]) โ€” this function returns an INT result giving the direction from which the moon will rise on the first moonrise on or after midnight on date. If date is not supplied, it defaults to today(). ๐Ÿงญ The return value ranges from 0 to 359, where 0 is North, 90 is East, 180 is South and 270 is West. Compass queen behavior. ๐Ÿ‘‘

moonset([d_date]) ๐ŸŒ™

okay so this one is the exact same energy as moonrise(), bestie, except it hands you the DATETIME of the next moonset that happens on or after midnight on date. like, "when does the moon clock out" energy. periodt. ๐Ÿ’…

moonsetdir([d_date]) ๐Ÿงญ

and this is the sibling of moonrisedir() โ€” it gives you back the direction of that moonset. compass girlies rise up ๐ŸŒˆ

multitrig(s_trig1 [,s_trig2, [... s_trigN]]) โฐโœจ

multitrig takes each string you give it, evaluates it like a trigger (same vibe as evaltrig), and returns the earliest trigger date that is on or after today(). she's basically trig's cooler cousin, but here's the tea โ˜•:

  • trig returns the first trigger date that would have triggered today
  • multitrig returns the earliest trigger date later than today, no matter whether it would have triggered today or not

and if literally no trigger can be computed that lands after today(), multitrig just goes "aight, 1990-01-01" ๐Ÿ’€

peep these examples, assuming today is Sunday, 24 March 2024:

# Returns 1990-01-01 because neither would trigger today
SET a trig("Mon", "Wed")

# Returns 2024-03-25 because it's the earlier trigger date
SET a multitrig("Mon", "Wed")

# Returns 2024-03-27 because it's the first that would trigger today
SET a trig("Wed +3", "Mon +3")

# Returns 2024-03-25 because it's the earlier trigger date
SET a multitrig("Wed +3", "Mon +3")

# Returns 1990-01-01 because all triggers have expired
SET a multitrig("2000", "2022", "1998", "2023")

ngl, multitrig just works better with the Remind algorithm than trig does, so you should lowkey be reaching for it most of the time. like, here's a reminder that fires at the end of each quarter:

REM [multitrig("Mar 31", "Jun 30", "Sep 30", "Dec 31")] +7 MSG \
%"End of [ord($Tm/3)] quarter%" is %b.

and if you're a "last working day of the quarter" kind of girlie, do this:

PUSH-OMIT-CONTEXT
OMIT Sat Sun
REM [multitrig("Mar ~1", "Jun ~1", "Sep ~1", "Dec ~1")] +7 MSG \
%"Last working day of [ord($Tm/3)] quarter%" is %b.
POP-OMIT-CONTEXT
โš ๏ธ heads up bestie: unlike evaltrig, multitrig always returns a DATE and never a DATETIME. so if you sneak an AT clause into a trigger you feed to multitrig, you get an error. no exceptions, no mercy ๐Ÿ˜ญ

ndawn([dq_date]) ๐ŸŒ…

gives you the time of "nautical dawn" on the date you pick. if you ghost the date, it defaults to today(). and if you hand it a datetime object, it only uses the date part, slay. โœจ

ndusk([dq_date]) ๐ŸŒ†

the twin flame of ndawn โ€” returns the time of "nautical twilight" on the date you specify. if date is omitted, again, defaults to today(). ๐Ÿซถ

nonomitted(dq_start, dq_end [, i_step] [,s_wkday...]) ๐Ÿ—“๏ธ๐Ÿ’–

this icon counts up the number of non-omitted days between start and end. if start is non-omitted, she gets counted. end? never counted. not even once. ๐Ÿ™ˆ

and if end is less than start, the arguments basically swap places, so the counting always starts from the older date. the math just works ๐Ÿ’…

if the third argument is an INT, it has to be greater than zero, and it becomes the step that nonomitted counts by. so like:

nonomitted('2023-07-01', '2023-07-29', 7)

returns the number of non-omitted Saturdays from 2023-07-01 up to (but not including) 2023-07-29. (and yes, both 2023-07-01 and 2023-07-29 are Saturdays. iconic coincidence โœจ)

if you don't supply a step argument, a step of 1 gets used by default. periodt.

beyond the global OMIT context, you can also pass extra arguments that are names of weekdays to be omitted. BUT โ€” in a REM command, any local OMITFUNC clause is not taken into account by this function. so don't come for her about that ๐Ÿ˜ค

for example, this line sets a to 11 (assuming no global OMITs):

set a nonomitted('2007-08-01', '2007-08-16', "Sat", "Sun")

because Thursday, 16 August 2007 is the 11th working day (not counting Saturday and Sunday) after Wednesday, 1 August 2007. ate that math up fr fr ๐Ÿ”ฅ

nonomitted has so many uses, it's giving main character energy. for example, lots of schools run on a six-day cycle and the day number does not get incremented on holidays. say the school year starts with Day 1 on 4 September 2007. this reminder will label day numbers in a calendar:

IF today() >= '2007-09-04'
    set daynum nonomitted('2007-09-04', today(), "Sat", "Sun")
    REM OMIT SAT SUN SKIP CAL Day [(daynum % 6) + 1]
ENDIF

obviously the answer you get from nonomitted depends on the global OMIT context. if you're out here using movable OMITs, you might get inconsistent results. you've been warned bestie ๐Ÿ’€

and here's a more complex glow-up use for nonomitted. so the author's garbage collection follows two interleaved 14-day cycles: one Friday, garbage and paper recycling ("Black Box") get collected. the next Friday, garbage and plastic recycling ("Blue Box") get collected. if any of Monday-Friday is a holiday, collection is delayed until the Saturday. here's how to encode those rules:

fset _garbhol(x) wkdaynum(x) == 5 && nonomitted(x-4, x+1) < 5
REM 12 November 1999 *14 AFTER OMITFUNC _garbhol MSG Black Box
REM 19 November 1999 *14 AFTER OMITFUNC _garbhol MSG Blue Box

here's how it works, iykyk: the _garbhol(x) user-defined function returns 1 if and only if (1) x is a Friday and (2) there's at least one OMITted day from the previous Monday up to and including the Friday. she's precise like that ๐Ÿ’…

the first REM statement sets up the 14-day black-box cycle. the AFTER keyword makes it move collection to the Saturday if _garbhol returns 1. the second REM statement sets up the 14-day blue-box cycle, with a similar adjustment made by AFTER in conjunction with _garbhol. two cycles, one icon. ๐Ÿ‘‘

nonconst(x_arg) ๐ŸŽญ

returns the argument arg unchanged, but forces the expression to be considered non-constant. for the deets, go read the section "NON-CONSTANT EXPRESSIONS". that's it, that's the function. short queen. ๐Ÿ’œ

now() โฑ๏ธ

returns the current system time, as a TIME type. this might be the actual time, or a time that was supplied on the command line. and note: in Calendar Mode, now() always returns 00:00. so if you're confused why it's midnight all the time, that's why bestie ๐Ÿ˜ญ

ord(i_num) ๐Ÿ”ขโœจ

returns a string that's the ordinal number num. like ord(2) returns "2nd" and ord(213) returns "213th". slay.

and for localization purposes: if you define a function called ordx that takes a single parameter, then calling ord(n) will invoke ordx(n) and return whatever that does. during the callback to ordx, RUN gets disabled. just so you know ๐Ÿ‘€

orthodoxeaster([dqi_arg]) ๐Ÿฃ๐Ÿฆ‹

  • if arg is an INT, you get the date of Orthodox Easter Sunday for that year
  • if arg is a DATE or DATETIME, you get the date of the next Orthodox Easter Sunday on or after arg (the time component of a datetime is ignored, ignore her back)
  • if arg is omitted, it defaults to today()
๐Ÿ“Œ note that orthodoxeaster computes the Orthodox Easter. for the Western Easter date, go check out easterdate. two different girlies, two different vibes.

ostype() ๐Ÿ’ป

returns "UNIX". that's the whole thing. Remind used to run on OS/2 and MS-DOS, but not any longer. rip to the old days but we're different now ๐Ÿ’…

pad(x_arg, s_padstr, i_len [, i_right]) ๐ŸŽ€

converts the first argument arg into a string if needed, then if it's shorter than len bytes, pads it out to len bytes using as many copies (including partial copies) of padstr as necessary. by default the string is left-padded, but if right is supplied and non-zero, it gets right-padded instead. choose your fighter โœจ

some examples for you:

pad(3, "0", 2)        -->  "03"
pad(465, "0", 2)      -->  "465"
pad("foo", " ", 5)    -->  "  foo"
pad("foo", " ", 5, 1) -->  "foo  "
pad("foo", "bar", 11) -->  "barbarbafoo"

mbpad(x_arg, s_padstr, i_len [, i_right]) ๐ŸŒธ

this is the multibyte counterpart to pad. the length is counted in characters instead of bytes. use mbpad instead of pad if either of the strings has non-ASCII characters in it. she speaks every language, bilingual queen ๐Ÿฆ‹

plural(i_num [,s_str1 [,s_str2]]) ๐Ÿซถ

takes anywhere from one to three arguments:

  • one argument โ†’ returns "s" if num isn't 1, and "" if num is 1
  • two arguments โ†’ returns str1 + "s" if num isn't 1. otherwise, just str1
  • three arguments โ†’ returns str1 if num is 1, and str2 otherwise

psmoon(i_phase [,i_size [,s_note [,i_notesize]]]) ๐ŸŒ

โš ๏ธ [DEPRECATED] bestie, this one's retired but we still love her

returns a STRING consisting of PostScript code that draws a moon in the upper-left hand corner of the calendar box. phase says what phase of the moon it is: 0 (new moon), 1 (first quarter), 2 (full moon) or 3 (third quarter). if size is specified, it controls the radius of the moon in PostScript units (1/72 inch). if it's not specified, or it's negative, the size of the day-number font gets used.

for example, these four lines put moon symbols on the PostScript calendar:

REM [moondate(0)] PS [psmoon(0)]
REM [moondate(1)] PS [psmoon(1)]
REM [moondate(2)] PS [psmoon(2)]
REM [moondate(3)] PS [psmoon(3)]

if note is specified, that text annotates the moon display. the font is the same font used for calendar entries. if notesize is given, it specifies the font size for that annotation, in PostScript units (1/72 inch). if notesize isn't given, it defaults to the size used for calendar entries.

๐Ÿšจ (if you annotate the display, be careful not to overwrite the day number โ€” Remind does not check for this.) so like, no cap, watch yourself ๐Ÿ™ˆ

for example, if you want the time of each new moon displayed, you could use this in your reminder script:

REM [moondate(0)] PS [psmoon(0, -1, moontime(0)+"")]

and note how the time gets coerced to a string by concatenating the null string. cute trick, remember it โœจ

psshade(i_gray) or psshade(i_red, i_green, i_blue) ๐ŸŽจ

โš ๏ธ [DEPRECATED] another legacy queen, still serving

returns a STRING made of PostScript commands that shade a calendar box. num can range from 0 (completely black) to 100 (completely white). if three arguments are given, they specify red, green and blue intensity from 0 to 100. here's an example of how to use it:

REM Sat Sun PS [psshade(95)]

that command right there emits PostScript code to lightly shade the boxes for Saturday and Sunday in a PostScript calendar. weekends get their own aesthetic, as they should ๐ŸŒˆ

โš ๏ธ Heads up bestie: psmoon and psshade are deprecated โ€” like, do not use them. Instead use the SPECIAL SHADE and SPECIAL MOON reminders, all described over in "Out-of-Band Reminders." ๐Ÿ’…

realcurrent()

Returns (as a DATETIME) the true date and time of day, straight from the operating system. โœจ This is not the same as current(), which might hand you back a time somebody typed on the command line. ๐Ÿ‘€

realnow()

Returns the true time of day as provided by the operating system. Contrast with now(), which may return a time supplied on the command line, or 00:00 in Calendar Mode. ๐Ÿ•›

realtoday()

Returns the date as provided by the operating system. This is in contrast to Remind's concept of "today," which may change if Remind is running in Calendar Mode, or if a date was supplied on the command line. ๐Ÿ—“๏ธ

rows()

If either standard output or standard error is a TTY, returns the height of the terminal in rows. ๐Ÿ“ If neither standard output nor standard error is a TTY, it attempts to open "/dev/tty" to obtain the terminal size. If that fails too? Returns -1. ๐Ÿ˜ญ

sgn(i_num)

Returns -1 if num is negative, 1 if num is positive, and 0 if num is zero. Simple math, slay. ๐Ÿ’…

shell(s_cmd [,i_maxlen])

Executes cmd as a system command, and returns the first 511 characters of output resulting from cmd. Any whitespace character in the output gets converted to a space. ๐Ÿซง

โš ๏ธ Note: if RUN OFF has been executed, or the -r command-line option has been used, shell() will result in an error, and cmd will not be executed. Periodt.

When shell runs cmd, it arranges for cmd's standard input file descriptor to be connected to /dev/null. ๐Ÿ•ณ๏ธ

If maxlen is specified, then shell() returns the first maxlen characters of output (rather than the first 511). If maxlen is specified as a negative number, then it defaults to the value of the system variable $MaxStringLen. ๐Ÿ’–

shellescape(s_str)

Returns str with all shell metacharacters such as " ", "*", etc. escaped with a backslash. Like, for example:

 SET a shellescape("a b*? c&d$e")

will set a to:

 "a\ b\*\?\ c\&d\$e"

Protect your strings, bestie. ๐Ÿ›ก๏ธโœจ

slide(d_start, i_amt [, i_step] [,s_wkday...])

This function is the inverse of nonomitted. It adds amt (which can be negative) chunks of step days to start, not counting omitted days. If step is not supplied, then it's assumed to be 1. Note that only every stepth day is tested to see if it is omitted, and that step must be positive. The optional wkday arguments are additional weekday names to omit. ๐Ÿ—“๏ธ

Consider this example:

     OMIT 14 May 2009
     SET a slide('2009-05-13', 5, "Sat", "Sun")

In this case, a is set to 2009-05-21. That's because we slide forward by 5 days, not including Thursday, May 14 or Saturday and Sunday, May 16 and 17. ๐Ÿง  You can go backwards, too, so:

     OMIT 14 May 2009
     SET a slide('2009-05-21', -5, "Sat", "Sun")

takes a back to 2009-05-13. ๐Ÿ”™

Now consider this example:

        OMIT 14 May 2009
        SET a slide('2009-05-07', 2, 7)

This sets a to '2009-05-28' because we skip ahead two weeks, not counting a week where the day we land on happens to be omitted. Contrast with this:

        OMIT 13 May 2009
        SET a slide('2009-05-07', 2, 7)

which sets a to '2009-05-21'. Although 2009-05-13 is omitted, we don't "land" on it as we step forward in chunks of 7 days, so we never see that it is omitted. ๐Ÿ‘€

If amt is zero, then slide always returns start. 0๏ธโƒฃ

soleq(i_which [, dqi_start])

The soleq function computes solstices and equinoxes. ๐ŸŒธ The which parameter ranges from 0 to 3, and specifies which event we're interested in:

  • 0 is the March equinox ๐ŸŒฑ
  • 1 is the June solstice โ˜€๏ธ
  • 2 is the September equinox ๐Ÿ‚
  • 3 is the December solstice โ„๏ธ

The optional start parameter can either be an integer specifying the year of the event we're interested in, or a DATE or DATETIME object; if it's the latter, then soleq returns the first event on or after the date part of the start parameter (it ignores the time component if start is a DATETIME). If start is not supplied, then it defaults to today(). ๐Ÿ’–

The return value of soleq() is a DATETIME object specifying the date and time of the solstice or equinox in the local time zone. It should be accurate to within 3 minutes or so in the worst case. โฑ๏ธ

See the included file $SysInclude/seasons.rem for examples of how to use soleq(). ๐Ÿ“‚

stdout()

Returns a string representing where Remind's standard output is going. The return values are one of the following: ๐Ÿซถ

  • "TTY" if standard-output is a terminal
  • "BLOCKDEV" if it is a block device (very unlikely)
  • "CHARDEV" if it is a character device (e.g., /dev/null)
  • "DIR" if it is a directory (very unlikely)
  • "PIPE" if it is a pipe or FIFO
  • "SYMLINK" if it is a symlink (very unlikely)
  • "SOCKET" if it is a socket
  • "UNKNOWN" if it could not be determined

The purpose of stdout() is mostly to distinguish between TTY and non-TTY output; you may wish to change or disable colors if the output is not going to a TTY. ๐ŸŒˆ

strlen(s_str)

Returns the length of str in bytes. If the length of str is too large to represent as an integer, emits a "Number too high" error. ๐Ÿšจ Note that strlen returns the number of bytes in the string, not the number of characters. These numbers are the same for ASCII strings, but may be different for UTF-8 strings. ๐Ÿฆ‹

mbstrlen(str)

Similar to strlen, but returns the length of the string in characters rather than bytes, and is thus safe for use on multi-byte strings. ๐Ÿ’œ

substr(s_str, i_start [,i_end])

Returns a STRING consisting of all bytes in str from start up to and including end. Bytes are numbered from 1. If end is not supplied, then it defaults to the length of str. Because substr uses byte indexes rather than character indexes, it should not be used on multi-byte strings. โš ๏ธ

mbsubstr(s_str, i_start [,i_end])

Similar to substr but uses character indexes rather than byte indexes, and is thus safe for use on multi-byte strings. โœจ

sunrise([dq_date])

Returns a TIME indicating the time of sunrise on the specified date (default today()). ๐ŸŒ… In high latitudes, there may be no sunrise on a particular day, in which case sunrise() returns the INT 0 if the sun never sets, or 1440 if it never rises. ๐Ÿคฏ

sunset([dq_date])

Returns a TIME indicating the time of sunset on the specified date (default today()). ๐ŸŒ‡ In high latitudes, there may be no sunset on a particular day, in which case sunset() returns the INT 0 if the sun never rises, or 1440 if it never sets. ๐Ÿคฏ

The functions sunrise() and sunset() are based on an algorithm in "Almanac for Computers for the year 1978" by L. E. Doggett, Nautical Almanac Office, USNO. ๐Ÿ“– They require the latitude and longitude to be specified by setting the appropriate system variables. (See "System Variables.") The sun functions should be accurate to within about 4 minutes for latitudes lower than 60 degrees. The functions are available starting from version 03.00.07 of Remind. โญ

time(i_hr, i_min)

Creates a TIME with the hour and minute components specified by hr and min. โฐ

timepart(tq_datetime)

Returns a TIME object representing the time portion of datetime. ๐Ÿ•ฐ๏ธ

timezone([dq_datetime])

Returns a string representing the local time zone name of the given DATETIME. ๐ŸŒ If no argument is supplied, Remind uses the value of current(). If a DATE rather than DATETIME is supplied, Remind uses a time part of 00:00. ๐Ÿ•›

today()

Returns Remind's notion of "today." ๐Ÿ“… This may be the actual system date, or a date supplied on the command line, or (in Calendar Mode) the date of the calendar entry currently being computed. ๐Ÿ‘‘

trig(s_1 [,s_2, ...])

For each string argument s_n, trig evaluates s_n as if it were a REM or IFTRIG trigger specification. If the trigger would trigger today, then the trigger date is returned and no further triggers are evaluated. If none of the triggers would trigger today, then the zero date 1990-01-01 is returned. ๐Ÿ“†

trig also has a zero-argument form; this returns the trigger date of the most recent trig function that returned a non-zero trigger date. ๐Ÿ”

trig can be used to make more sophisticated versions of IFTRIG. For example, if you have meetings every Monday in June and July, and you want warnings 3 days in advance, you could use: ๐Ÿ’–

    REM [trig("Mon Jun +3", "Mon July +3")] +3 MSG Meeting %b
๐Ÿ“Œ NOTE: We need to repeat the +3 delta outside of the trig function for advance warning to work properly. This is because trig returns a date constant (the trigger date) and the REM command does not know the details of trig's arguments.

Note that because Remind has short-circuit logical operators, something like:

    SET a trig("Mon +7") || trig("Fri +7")

would set the value of trig() to the date of the following Monday. Because trig("Mon +7") always returns true, the logical-OR operator does not bother evaluating trig("Fri +7") which therefore does not set trig(). ๐Ÿ˜ฎ

๐Ÿšจ Important Note: Because trig() always returns an absolute date, it will not work properly with a SATISFY clause. Consider this reminder:
    REM [trig("Mar", "Apr")] SATISFY [$Td == 15] MSG 15 Mar or April

If we run Remind on 5 March 2022, we might expect the trigger date to be calculated as 15 March 2022... but that's not what happens. Instead, the trig function is evaluated first, and it returns 2022-03-05. So as far as Remind is concerned, the REM statement becomes:

    REM 2022-03-05 SATISFY [$Td == 15] MSG 15 Mar or April

and the SATISFY expression is never true. So: Do not mix trig() and SATISFY. ๐Ÿ’€

  • trigdate() โ€” gives you back the calculated trigger date of the most recent REM or IFTRIG command ๐Ÿ’–. If you call it inside the body of a REM command, it hands you that command's trigger date. And if the last REM command couldn't compute a trigger date at all? You get the integer 0. That's it, that's the vibe.
  • trigdatetime() โ€” like trigdate() but glowier โœจ. It returns a DATETIME if the most recent triggerable REM command had an AT clause. No AT clause? Then you get a DATE. Couldn't compute a trigger? You get the integer 0. Peep MULTI-DAY EVENTS for the tea.
  • trigeventstart() โ€” returns a DATETIME that represents the start of the most recent triggerable REM command that had an AT clause ๐Ÿซถ. For events with no DURATION, or ones that don't span multiple days, it returns the same thing as trigdatetime(). But if the REM command had no AT clause, it returns the integer -1 โ€” and yes, that's exactly where it differs from trigdatetime(). Peep MULTI-DAY EVENTS for more.
  • trigeventstarttz() โ€” same energy as trigeventstart() but it returns the DATETIME in the time zone given by a TZ clause, if there was one ๐ŸŒ. No TZ clause? Then it returns the same value as trigeventstart().
  • trigeventduration() โ€” returns a TIME representing the duration of the most recent triggerable REM command that had both an AT and a DURATION clause โณ. If the event doesn't span multiple days, it returns the same thing as trigduration(). If the REM command was missing an AT or DURATION clause, you get -1. Peep MULTI-DAY EVENTS for more.
  • trigback() โ€” returns the "back" amount of the last REM or IFTRIG command ๐Ÿ‘‘. Positive integer N if the "back" looks like -N, or a negative integer if it looks like --N. No "back" at all? Then 0.
  • trigbase() โ€” returns the "base" date of the last REM or IFTRIG command ๐ŸŽ€. If the trigger spec has all three of day, month and year, then the base date is the date built from those components. If the trigger spec is missing one of those three, you get 0.

Here's how you might use trigbase():

REM 2025-05-05 *7 UNTIL 2025-05-26 \
   MSG Meeting: week #[(trigdate() - trigbase())/trigrep()+1]

On 2025-05-05, it would print: "Meeting: week #1". On 2025-05-12, it would print: "Meeting: week #2" and so on ๐Ÿ’….

  • trigdelta() โ€” returns the "delta" amount of the last REM or IFTRIG command ๐Ÿฆ‹. Positive integer N if the "delta" is of the form +N, or a negative integer if it's of the form ++N. No "delta"? Then 0.
  • trigtimedelta() โ€” like trigdelta(), but returns the delta used in the AT clause of a timed reminder โฐ.
  • trigrep() โ€” returns the "repeat" amount of the last REM or IFTRIG command ๐Ÿ”. Positive integer N if the "repeat" is of the form *N. No "repeat"? Then 0.
  • trigtimerep() โ€” like trigrep(), but returns the repeat used in the AT clause of a timed reminder ๐ŸŒธ.
  • trigtz() โ€” if a TZ clause was used in the last REM or IFTRIG command, it returns the time zone name ๐Ÿ—บ๏ธ. Otherwise it returns the empty string.
  • trigduration() โ€” returns (as a TIME type) the DURATION parameter of a timed reminder โŒ›. No DURATION parameter? Then you get the integer -1. Peep MULTI-DAY EVENTS for more.
  • trigpriority() โ€” returns the PRIORITY of the last REM or IFTRIG command โญ.
  • triguntil() โ€” returns (as a DATE type) the UNTIL parameter of the last REM or IFTRIG command ๐Ÿ“…. No UNTIL parameter? Then you get the integer -1. And heads up: if there's a THROUGH parameter, triguntil() returns that one, because "THROUGH yyyy-mm-dd" is literally just syntactic sugar for "*1 UNTIL yyyy-mm-dd" ๐Ÿฌ.
  • trigscanfrom() โ€” returns (as a DATE type) the SCANFROM parameter of the last REM or IFTRIG command ๐Ÿ”. No SCANFROM parameter? Then you get the integer -1. But bestie, FROM and SCANFROM interact: a reminder that has a "FROM yyyy-mm-dd" parameter will act as if it has a SCANFROM parameter whose value is the maximum of "yyyy-mm-dd" and today. Noted. ๐Ÿ’œ
  • trigfrom() โ€” returns (as a DATE type) the FROM parameter of the last REM or IFTRIG command ๐ŸŒˆ. No FROM parameter? Then you get the integer -1.
  • triginfo(s_header) โ€” returns a STRING that is the INFO item associated with the header header ๐Ÿท๏ธ. The header should not contain a colon. Header name comparisons are case-insensitive, so don't stress the caps.

For example, this assigns "At home" to the variable a and the empty string to variable b:

REM INFO "Location: At home" MSG test
SET a triginfo("location")
SET b triginfo("no_such_header")
  • trigistodo() โ€” returns 1 if the last REM command was a TODO type, or 0 if not โœ….
  • trigcompletethrough() โ€” returns a DATE object that is the COMPLETE-THROUGH date of the most recent REM command ๐Ÿ“Œ. No COMPLETE-THROUGH date? Then you get the INT 0.
  • trigmaxoverdue() โ€” returns an INT that is the MAX-OVERDUE value of the most recent REM command ๐Ÿ˜ฌ. No MAX-OVERDUE clause? Then you get -1.
  • trigger(d_date [,t_time [,i_utcflag]]) or trigger(q_datetime [,i_utcflag]) โ€” returns a string you can drop straight into a REM command, or a SCANFROM or UNTIL clause, so you can calculate trigger dates way ahead of time ๐Ÿ”ฎ. Fun lore drop: in earlier versions of Remind, trigger was required to convert a date into something the REM command could eat. But in this version of Remind, you can just omit it. Slay.

Normally the date and time are the local date and time. But if utcflag is non-zero, the date and time are interpreted as UTC times and get converted to local time ๐ŸŒ. Examples:

trigger('1993/04/01')

returns "1 April 1993",

trigger('1994/08/09', 12:33)

returns "9 August 1994 AT 12:33", and so does:

trigger('1994/08/09@12:33')

And finally:

trigger('1994/12/01', 03:00, 1)

returns "30 November 1994 AT 22:00" for EST, which is 5 hours behind UTC. Your own time zone's value may differ, iykyk.

Important: trigger() will never return a date earlier than "1 January 1990", even if the UTC flag says it should. So do not use it for reminders before about 2 January 1990 in your local time zone. The author says they do not anticipate this restriction being a real problem ๐Ÿ™ˆ.
  • trigtags() โ€” returns a comma-separated list of the TAGs associated with the most recent REM command that was triggered ๐Ÿท๏ธโœจ. Returns the empty string if there were no TAGs. And if there are multiple tags, each one is separated by a single comma โ€” not a comma and a space. Details matter, bestie ๐Ÿ’….
  • trigtime() โ€” returns the time of the last REM command with an AT clause, in the system default time zone โฐ. If the last REM had no AT clause, it returns the integer 0. Oh, and if a REM command has an AT clause with a DURATION, you can compute the end time as trigtime() + trigduration(). Math ate. ๐Ÿงฎ
  • trigtimetz() โ€” like trigtime() but returns the time in the time zone specified by a TZ clause, if one was present ๐ŸŒ. No TZ clause? Then it returns the same value as trigtime().
  • trigvalid() โ€” returns 1 if the value returned by trigdate() is valid for the most recent REM command, or 0 otherwise ๐ŸŽฏ. Sometimes REM commands just cannot calculate a trigger date. Like, for example, this REM command can never be triggered:
REM Mon OMIT Mon SKIP MSG Impossible!

Truly impossible. ๐Ÿ’€

  • typeof(x_arg) โ€” returns "STRING", "INT", "DATE", "TIME" or "DATETIME", depending on the type of arg ๐Ÿงฌ.
  • tzconvert(q_datetime, s_srczone [,s_dstzone]) โ€” converts datetime from the time zone named by srczone to the time zone named by dstzone ๐Ÿ•ฐ๏ธโžก๏ธ๐Ÿ•ฐ๏ธ. If srczone is the empty string, the default system time zone is used as the source zone. If dstzone is omitted or is the empty string, the default system time zone is used as the destination zone. The return value is a DATETIME. Time zone names are system-dependent, so go consult your operating system for legal values, fr fr.

Here's an example:

tzconvert('2007-07-08@01:14', "Canada/Eastern", "Canada/Pacific")

returns

2007-07-07@22:14

Also: if your system includes the directory /usr/share/zoneinfo, Remind will warn you if you use an invalid time zone name for srczone or dstzone. To suppress those warnings, add a "!" to the beginning of the time zone name ๐Ÿ”•.

  • upper(s_string) โ€” returns a STRING with all lower-case bytes in string converted to upper-case ๐Ÿ” . Note: this function works correctly only for ASCII strings. If you're using Unicode characters outside the ASCII set, use mbupper instead. Respect the range. ๐Ÿ’œ
  • mbupper(s_string) โ€” returns a STRING with all lower-case characters in string converted to upper-case ๐Ÿ”ก. This one works correctly on any Unicode string. Versatile icon. โœจ
  • utctolocal(q_datetime) โ€” given a DATETIME object interpreted in UTC, returns a DATETIME object that expresses the same time in the local time zone ๐ŸŒ.
  • value(s_varname [,x_default]) โ€” returns the value of the specified variable ๐ŸŽ. For example, value("X"+"Y") returns the value of variable XY, if it is defined. If XY is not defined, an error results. Not a vibe.

However! If you supply a second argument, that's what gets returned when varname isn't defined. The expression value("XY", 0) will return 0 if XY is not defined, and the value of XY if it is defined. Also note that value evaluates the second argument lazily โ€” it is not evaluated if varname is defined ๐Ÿ˜Œ.

  • version() โ€” returns a string specifying the version of Remind ๐Ÿท๏ธ. For version 06.03.03, it returns "06.03.03". And it's guaranteed that as new versions of Remind get released, the value returned by version() will strictly increase, according to the rules for string ordering ๐Ÿ“ˆ. Growth mindset only.

๐ŸŒธ weekno([dq_date, [i_wkstart, [i_daystart]]])

Returns the week number of the year, bestie. ๐Ÿ“… No arguments at all? Then you get the ISO 8601 week number for today(). Give it one argument, date, and it hands back the ISO 8601 week number for that date instead. Give it two arguments and wkstart has to range from 0 to 6 โ€” it's the first day of the week, where 0 is Sunday and 6 is Saturday, iykyk. If you don't supply wkstart, it defaults to 1. And if you supply that third argument, daystart, it tells Remind when Week 1 starts: if daystart is less than or equal to 7, then Week 1 starts on the first wkstart on or after January daystart. Otherwise, Week 1 starts on the first wkstart on or after December daystart. Omit it and daystart defaults to 29 (which is literally just the ISO 8601 definition, iconic behavior).

๐Ÿฆ‹ wkday(dqi_arg)

If arg is a DATE or DATETIME, you get back a string representing the day of the week of that date. If arg is an INT from 0 to 6, you get the corresponding weekday string, "Sunday" through "Saturday". So cute, so simple. โœจ

๐ŸŽ€ wkdaynum(dq_date) or wkdaynum(s_str)

Returns a number from 0 to 6 representing the day-of-week of the date you specified. (0 is Sunday, 6 is Saturday โ€” same deal as always.) And if you hand it a STRING? Then if str is a valid weekday name (or a minimum 3-character abbreviation of one), the matching weekday number comes right back to you. But if str is not a valid weekday name, an error occurs. ๐Ÿ’€ No vibes-based guessing here.

๐Ÿ‘‘ year(dq_date)

Returns an INT that is the year component of date. That's it, that's the whole function, and honestly? We stan a one-job legend.


๐ŸŒˆ INTERPOLATED STRINGS

Okay so besides the normal string constants you write in double quotes, Remind expressions also support a type of string called an interpolated string, and you write those in back-ticks. Here's both of them side by side so you can see the glow-up:

# A normal string
SET a "Hello, [name]!"

# An interpolated string
SET b `Hello, [name]!`

In the first example, a is set to the string constant "Hello, [name]!" โ€” and the square brackets mean absolutely nothing special there. They're just little decorations. ๐ŸŽ€

The second example, though? It's treated exactly as if you had written this:

SET b join("Hello, ", name, "!");

The parser breaks an interpolated string into chunks, where each chunk is either a run of normal characters or an expression wrapped in square brackets. Then it compiles the whole thing into a call to join, with each chunk passed as an argument. The runs of normal characters get treated as string constants, and the expressions inside the square brackets get treated as expressions. Slay. ๐Ÿ’…

Interpolated strings make concatenation so much easier. Like, look at these three lines:

SET filename $SysInclude + "/" + basename + ".rem"
SET filename join($SysInclude, "/", basename, ".rem")
SET filename `[$SysInclude]/[basename].rem`

They both achieve exactly the same result, and in fact, the third example is compiled to exactly the same internal representation as the second example. (Yes bestie, the original says "both" about three things โ€” we're keeping it exactly as written, no notes. ๐Ÿ™ˆ)

Inside a function definition, interpolated expressions can refer to function arguments. For example, this code:

FSET many(x) `Here are [x] A's: [x * "A"]`
set a many(4)

sets a to "Here are 4 A's: AAAA". No cap, that's the actual output. ๐Ÿ”ฅ

Interpolated strings support the same backslash-escape sequences as regular strings (eg, "\a", "\b", "\xAB", etc.). And to insert a literal left square bracket, you write "[[". Noted, saved, screenshotted. ๐Ÿ“ธ


๐Ÿงš MACHINES WITH A 32-BIT TIME_T TYPE

Internally, the standard C library represents times as a time_t type. It's a signed integer type that counts seconds since midnight, 1 January 1970 UTC. And if time_t is only 32 bits in size, then the C library cannot represent times after 19 January 2038 at 03:14:07 UTC. ๐Ÿ˜ญ That's the vibe. That's the limit.

To work around this limitation, Remind will "fold" years greater than 2037 to a smaller year that begins on the same day and has the same number of days. This gives you a year that's very likely to have the same daylight saving rules as the original year โ€” unless the rules have changed in the interim (in which case the rule change couldn't even be represented on a 32-bit machine, so it's moot anyway). ๐Ÿซถ

Remind then does UTC-to-local or local-to-UTC conversions with the folded year, and then post-conversion corrects it back. This should give correct results for astronomical functions and conversions between local and UTC time, providing the daylight saving time rules have not changed between the folded year and the original year.

Heads up: the $FoldYear system variable is no longer that useful โ€” Remind always folds years if it's necessary on a 32-bit system. You can set $FoldYear to 1 to force Remind to fold years even on a 64-bit system, but that's useful only for testing and not for production. Don't be chaotic. ๐Ÿšซ

๐Ÿ’– MULTI-DAY EVENTS

If you specify a start time with AT and a duration with DURATION, you can create events that span multiple days. Main character energy, honestly. Consider these two REM statements:

REM 1991-02-13 AT 16:00 DURATION 72:00 MSG 72-hour event
REM 1991-02-13 THROUGH 1991-02-16 AT 16:00 MSG Four events

The first statement creates a single event that starts on 13 February 1991 at 16:00 and runs through 16 February 1991 at 16:00.

The second statement creates four separate events that start at 16:00 on 13, 14, 15 and 16 February 1991 and have indefinite duration.

Remind handles multi-day events specially. These are the rules:

  • On the first day of a multi-day event, trigdatetime() will return the starting date and time of the event, and trigduration() will return the original DURATION.
  • On each subsequent day of a multi-day event, trigdatetime() will return midnight on the day in question, and trigduration() will return the remaining duration.

Consider this example:

#!/bin/sh
remind - 12 feb 1991 '*6' <<'EOF'
BANNER %
REM 1991-02-13 AT 16:00 DURATION 72:00 SATISFY 1
set a trigdatetime()
set b trigduration()
set c trigeventstart()
set d trigeventduration()
MSG now=[today()] dt=[a] dur=[b] estart=[c] edur=[d]%
EOF

The output is:

now=1991-02-12 dt=1991-02-13@16:00 dur=72:00 estart=1991-02-13@16:00 edur=72:00
now=1991-02-13 dt=1991-02-13@16:00 dur=72:00 estart=1991-02-13@16:00 edur=72:00
now=1991-02-14 dt=1991-02-14@00:00 dur=64:00 estart=1991-02-13@16:00 edur=72:00
now=1991-02-15 dt=1991-02-15@00:00 dur=40:00 estart=1991-02-13@16:00 edur=72:00
now=1991-02-16 dt=1991-02-16@00:00 dur=16:00 estart=1991-02-13@16:00 edur=72:00
now=1991-02-17 dt=1991-02-13@16:00 dur=72:00 estart=-1 edur=-1

As you see, the trigdatetime() and trigduration() functions return the start time and duration of the remaining portion of a multi-day event, whereas trigeventstart and trigeventduration always return the original start and duration of the multi-day event. Note also that the return value for expired reminders is not reliable โ€” the fact that trigeventstart and trigeventduration return -1 in that case is an implementation artifact. ๐Ÿ’€

๐Ÿฆ‹ SELF-OVERLAPPING EVENTS

A multi-day event has the possibility of "overlapping itself". When this happens, Remind prefers the later event (only one copy of an event is ever triggered for a given date). Consider this example:

#!/bin/sh
remind - '*5' 10 Feb 1991 <<'EOF'

BANNER %
REM MON at 0:00 DURATION 192:0 MSG [today()] [trigeventstart()] [trigduration()]%

EOF

The output is:

1991-02-10 1991-02-04@00:00 48:00
1991-02-11 1991-02-11@00:00 192:00
1991-02-12 1991-02-11@00:00 168:00
1991-02-13 1991-02-11@00:00 144:00
1991-02-14 1991-02-11@00:00 120:00

Although the event from 1991-02-04 still has 24 hours left on 1991-02-11, the fresh occurrence on 1991-02-11 takes precedence and is the one that is triggered. Newer is better, apparently. ๐Ÿ’…

I do not recommend constructing self-overlapping multi-day events. Fr fr, just don't. ๐Ÿšซโœจ

๐Ÿ’– EXPRESSION PASTING ๐Ÿ’–

okay bestie, sit DOWN, because this is one of the most powerful features Remind has and it's literally called expression pasting and it's basically macros but make it cute. ๐Ÿฆ‹

So here's the vibe: in almost any situation where Remind is not expecting an expression, you can just... paste one in. How? Wrap your expression in square brackets. Like this:

REM [mydate] MSG foo

That evaluates the expression mydate (which is presumably some pre-computed variable you set up earlier), and then pastes the result right into the command-line for the parser to chew on. โœจ

And if you genuinely want a literal [ character for some reason? Just use [[. Easy. Example:

REM MSG Here are [[square] brackets!

Okay so the formal description, because we're being thorough: when Remind encounters a "pasted-in" expression, it evaluates the expression, and coerces the result to a STRING. Then it substitutes that string for the pasted-in expression and keeps parsing. BUT โ€” and this is important โ€” expressions are evaluated only once, not recursively. So if you write:

["[a+b]"]

Remind just reads the token [a+b]. It does not interpret that as another pasted-in expression. One and done, periodt. ๐Ÿ’…

You can use expression pasting almost anywhere. That said, there are a few exceptions, and we're gonna go through them one by one:

  • If Remind is expecting an expression โ€” like in the SET command, or the IF command โ€” you should not include square brackets. So use:
SET a 4+5

and not:

SET a [4+5]
  • You cannot use expression pasting for the first token on a line. For example, this will not work:
["SET"] a 1

This restriction exists because Remind has to be able to unambiguously determine the first token of a line for the flow-control commands (we'll get into those later, bestie). In fact, if Remind can't determine the first token on a line, it assumes it's a REM command. And if expression-pasting is used, Remind assumes it's a REM command too. So check it โ€” these three commands are all equivalent:

REM 12 Nov 1993 AT 13:05 MSG BOO!
12 Nov 1993 AT 13:05 MSG BOO!
[12] ["Nov " + 1993] AT [12:05+60] MSG BOO!
  • You cannot use expression-pasting to determine the type (MSG, CAL, etc.) of a REM command. You can paste expressions before and after the MSG, etc. keywords, but you can't do something like this:
REM ["12 Nov 1993 AT 13:05 " + "MSG" + " BOO!"]

However โ€” escape hatch alert ๐Ÿšจ โ€” the sequence SPECIAL type means the same thing as just type, where type is one of MSG, MSF, RUN, CAL, PS and PSFILE. This lets you do something like:

SET type "MSG"
REM 12 Nov 2024 SPECIAL [type] Hello

You can use this to control the types of your reminders based on variables you set, how Remind is invoked, etc. main character behavior honestly ๐Ÿ‘‘


๐Ÿซถ COMMON PITFALLS WITH EXPRESSION PASTING ๐Ÿซถ

Okay so first pitfall, and it gets people every time: extra spaces are NOT inserted when an expression is pasted. So something like:

REM[expr]MSG[expr]

will probably fail. ๐Ÿ’€ Like it just won't work, sorry bestie.

Second one: if you use an expression to calculate a delta or back, make sure the result is a positive number. Because something like:

REM +[mydelta] Nov 12 1993 MSG foo

will fail if mydelta happens to be negative. No negative deltas allowed, nope, not today. ๐Ÿ™ˆ


๐ŸŒˆ FLOW CONTROL COMMANDS ๐ŸŒˆ

Remind has commands that control the flow of a reminder script, and this is where things get genuinely fun. Normally, reminder scripts are processed sequentially โ€” top to bottom, no drama. However, IF and related commands let you process files conditionally, and skip sections that you don't want interpreted. Skipping is self-care, fr fr. โœจ

๐ŸŽ€ THE IF COMMAND ๐ŸŽ€

The IF command has this form:

IF expr
     t-command
     t-command...
ELSE
     f-command
     f-command...
ENDIF

Just so you know, the commands are shown indented for clarity โ€” the indentation is not required. Also, the ELSE portion can be omitted entirely. And IF commands can be nested up to a depth of 64, across all levels of INCLUDE. Sixty-four levels deep, iconic. ๐Ÿงš

Now the vibe check: if expr evaluates to a non-zero INT, a DATE that is not 1990-01-01, a TIME that is not 00:00, a DATETIME that is not 1990-01-01@00:00, or a non-null STRING, then the IF portion is considered true, and the t-commands are executed. If expr evaluates to zero or null, then the f-commands (if the ELSE portion is present) are executed. Simple as that. ๐Ÿ’–

Examples:

IF defined("want_hols")
     INCLUDE /usr/share/remind/holidays
ENDIF

IF today() > '1992/2/10'
     set missed_ap "You missed it!"
ELSE
     set missed_ap "Still have time..."
ENDIF

๐Ÿ’œ THE IFTRIG COMMAND ๐Ÿ’œ

The IFTRIG command is similar to an IF command, except that it computes a trigger (as in the REM command), and evaluates to true if a corresponding REM command would trigger. Examples:

IFTRIG 1 Nov
     ; Executed on 1 Nov
ELSE
     ; Executed except on 1 Nov
ENDIF

IFTRIG 1 -1 OMIT Sat Sun +4
     ; Executed on last working day of month,
     ; and the 4 working days preceding it
ELSE
     ; Executed except on above days
ENDIF

Okay so note that the IFTRIG command computes a trigger date, which you can retrieve with the trigdate() function. You can use all of the normal trigger components, such as UNTIL, delta, etc. in the IFTRIG command. However, you cannot use a type specifier such as CAL, MSG or SATISFY โ€” attempting to do so yields a parse error. So don't do it, bestie. ๐Ÿ˜ญ


๐ŸŒธ USER-DEFINED FUNCTIONS ๐ŸŒธ

In addition to the built-in functions, Remind lets you define your own functions. The FSET command does this for you:

FSET fname(args) expr

Fname is the name of the function, and it follows the convention for naming variables. Args is a comma-separated list of arguments, and expr is an expression. And here's the important part: expr is not evaluated at the time the function is defined โ€” instead, it is evaluated each time the function is called. Args can be empty, in which case you define a function taking no parameters. Here are some examples:

FSET double(x) 2*x
FSET yeardiff(date1, date2) year(date1) - year(date2)
FSET since(x) ord($Ty - x)

That last function is genuinely so useful in birthday reminders. For example:

REM 1 Nov +12 MSG Dean's [since(1984)] birthday is %b.

Dean was born in 1984. So the above example, on 1 November 1992, would print:

Dean's 8th birthday is today.

Similarly, the function is useful in anniversary reminders. For example:

REM 4 June MSG [since(1989)] anniversary of the Tienanmen Square massacre

Notes, because there are quite a few and you don't wanna miss them:

  • If you access a variable in expr that is not in the list of arguments, the global value (if any) is used.
  • Function and parameter names are significant to 64 characters.
  • The value() function always accesses the global value of a variable, even if it has the same name as an argument. For example:
fset func(x) value("x")
set x 1
set y func(5)

The above sequence sets y to 1, which is the global value of x.

  • User-defined functions may call other functions, including other user-defined functions. Recursive calls are allowed, but they must terminate (for example, by using a short-circuit operator or function that breaks the recursion) or an error will result after a certain maximum number of recursive calls (by default, 1000.)
  • If a user-defined function has the same name as a built-in function, it is ignored and the built-in function is used. To prevent conflicts with future versions of Remind (which may define more built-in functions), you may wish to name all user-defined functions beginning with an underscore.
  • If a user-defined function is defined in a context where RUN is disabled, then whenever that function is called, RUN will be disabled during its evaluation, even if it is called from a context where RUN is enabled. Sneaky but true.

To delete a user-defined function, use FUNSET. This takes a space-separated list of user-defined functions to delete. For example, after the command:

FUNSET myfunc1 otherfunc thirdfunc

it is guaranteed that no user-defined functions named myfunc1, otherfunc or thirdfunc will exist. And here's the chill part: Remind does not issue an error if you try to FUNSET a nonexistent user-defined function โ€” it simply does nothing in that case. No drama, no error, just vibes. ๐Ÿฆ‹

You can rename a user-defined function with FRENAME. This takes two names: an old name and a new name. Consider this command:

FRENAME func_a func_b

If func_a does not exist, the command unsets func_b if it is defined. However, if func_a exists, then it is renamed to func_b, and func_a is no longer defined. And if func_b was defined prior to the FRENAME command, then that old definition is lost. Gone. Poof. ๐Ÿ’€

If either argument to the FRENAME command is the name of a built-in function, the command fails with an error message and does nothing.

And finally: if you define a user-defined function and then later on redefine it, Remind will issue a warning. If you do not want this warning, then use FUNSET to remove the existing definition before you redefine the function. Alternatively, you can use a - token before the function name to suppress "redefined function" warnings, as in the following example:

FSET - f(x) 2*x
# You must have space before and after the "-"
# This will NOT work:
# FSET -f(x) 2*x
okay so literally the space before and after that - is not optional, bestie. FSET - f(x) slays, FSET -f(x) does not. iykyk ๐Ÿ’…

โœจ SAVING AND RESTORING FUNCTIONS โœจ

ok so sometimes you wanna give a function a lil glow-up for just one block of reminders, and then snap it right back to how it was before. bestie, you can do that. just like with variables, functions can get pushed onto and popped off an internal stack. here's the vibe:

PUSH-FUNCS msgprefix
FSET msgprefix(x) "My new prefix: "
INCLUDE block_of_reminders.rem
POP-FUNCS

so block_of_reminders.rem gets run with the msgprefix function defined like that up top. and after POP-FUNCS, msgprefix goes back to whatever it was before โ€” or, if it never existed, it just gets unset. no trace. ๐Ÿ’…

the command PUSH-FUNCS takes a space-separated list of function names, and every one of those named user-defined functions gets saved to an internal stack. fun fact: you can literally push names that aren't defined as any function at all. no questions asked.

once a function name has been pushed, Remind will not warn you if you redefine it โ€” because like, obviously, that's the whole point of pushing it in the first place. ๐Ÿ’–

POP-FUNCS restores the definitions of all the user-defined functions from the matching PUSH-FUNCS command. and if you pushed functions that were undefined? POP-FUNCS makes them undefined again. symmetry, we love to see it. โœจ

one more example, because examples are the main character:

FUNSET a
FSET b(x) 2*x
REM MSG [b(3)]   # Outputs 6
PUSH-FUNCS a b
FSET a(x) 22*x
FSET b(x) 3*x
REM MSG [a(3)] [b(3)] # Outputs 66 9
POP-FUNCS
REM MSG [a(3)]   # Undefined function "a"
REM MSG [b(3)]   # Outputs 6

๐ŸŒˆ PRECISE SCHEDULING ๐ŸŒˆ

the WARN keyword gives you precise control over advance warning, and honestly it's way more flexible than the delta mechanism. it should be followed by the name of a user-defined function, warn_function.

if a warn_function is supplied, it must take one argument of type INT. Remind ignores any delta and instead calls warn_function successively with the arguments 1, 2, 3, ... ๐Ÿ”ฅ

the return value n from warn_function gets interpreted like this:

  • if n is positive, then the reminder is triggered exactly n days before its trigger date.
  • if n is negative, then it's triggered n days before its trigger date, not counting OMITted days.

say you wanna be warned about American Independence Day 5, 3, and 1 days in advance. you'd do:

FSET _wfun(x) choose(x, 5, 3, 1, 0)
REM 4 July WARN _wfun MSG American Independence Day is %b.

๐Ÿ“ NOTES ๐Ÿ“

  1. if an error happens while evaluating warn_function, then Remind stops calling it and just issues the reminder on its trigger date.
  2. if the absolute-values of the return values of warn_function are not monotonically decreasing, Remind stops calling it and issues the reminder on its trigger date.
  3. warn_function should (as a matter of good style) return 0 as the final value in its sequence of return values. but a reminder will always be triggered on its trigger date regardless of what warn_function does.

similarly to WARN, the SCHED keyword lets you precisely control the scheduling of timed reminders. it should be followed by the name of a user-defined function, sched_function. heads up: if you use SCHED, then any tdelta and trep are ignored. ๐Ÿ™ˆ

if a scheduling function is supplied, it must take one argument of type INT. instead of using the AT time, time delta, and time repeat, Remind calls the scheduling function to figure out when to trigger the reminder. the first time the reminder is queued, the scheduling function gets called with an argument of 1. each time the reminder is triggered, it gets re-scheduled by calling the scheduling function again, and on each call the argument is incremented by one.

the return value of the scheduling function must be an INT or a TIME. if it's a TIME, the reminder is re-queued to trigger at that time. if it's a positive integer n, the reminder is re-queued to trigger at the previous trigger time plus n minutes. and finally, if it's a negative integer or zero, the reminder is re-queued to trigger n minutes before the AT time. note that there must be an AT clause for the SCHED clause to do anything. ๐Ÿซถ

here's an example:

FSET _sfun(x) choose(x, -60, 30, 15, 10, 3, 1, 1, 1, 1, 0)
REM AT 13:00 SCHED _sfun MSG foo

the reminder would first be triggered at 13:00-60 minutes, or at 12:00. it would next be triggered 30 minutes later, at 12:30. then it'd be triggered at 12:45, 12:55, 12:58, 12:59, 13:00, 13:01 and 13:02. look at that little timeline go. ๐Ÿฆ‹

๐Ÿ“ NOTES ๐Ÿ“

  1. if an error happens while evaluating sched_func, then Remind reverts to using the AT time and the delta and repeat values, and never calls sched_func again.
  2. if processing sched_func yields a time earlier than the current system time, it is repeatedly called with increasing argument until it yields a value greater than or equal to the current time. however, if the sequence of values calculated during the repetition is not strictly increasing, then Remind reverts to the default behaviour and never calls sched_func again.
  3. it is quite possible using sched_func to keep triggering a reminder even after the AT-time. also, it is quite possible to not trigger a reminder on the AT time when you use a scheduling function. however, if your scheduling function is terminated (for reasons 1 and 2) before the AT time of the reminder, it will be triggered at the AT time, because normal processing takes over.
  4. your scheduling functions should (as a matter of good style) return 0 when no more scheduling is required. see the example.
  5. all scheduling functions are evaluated after the entire Remind script has been read in. so whatever function definitions are in effect at the end of the script are used. ๐Ÿ‘‘

๐Ÿ’œ THE SATISFY CLAUSE ๐Ÿ’œ

the form of REM that uses SATISFY looks like this:

REM trigger SATISFY expr

here's how it actually goes down: Remind first calculates a trigger date, in the normal fashion. next, it sets trigdate() to that calculated trigger date. then it evaluates expr. if the result is not the null string or zero, processing ends. otherwise, Remind computes the next trigger date and re-tests expr. this iteration keeps going until expr evaluates to non-zero or non-null, or until the iteration limit specified with the -x command-line option is reached. ๐Ÿ˜ค

if expr is not satisfied, then trigvalid() is set to 0 and the error message "Can't compute trigger" is issued. otherwise, trigvalid() is set to 1.

this is really only useful if expr involves a call to the trigdate() or related functions or system variables โ€” otherwise expr just won't change as Remind iterates. in fact, if expr is not a constant and does not call trigdate() or related functions or system variables, then Remind will issue a warning. โš ๏ธ

an example of how useful SATISFY is: suppose you wanna be warned of every Friday the 13th. your first attempt might be:

# WRONG!
REM Fri 13 +2 MSG Friday the 13th is %b.

but bestie, this won't work. this reminder triggers on the first Friday on or after the 13th of each month. the way to actually do it is with a more complicated sequence:

REM 13 SATISFY wkdaynum(trigdate()) == 5
IF trigvalid()
     REM [trigdate()] +2 MSG \
     Friday the 13th is %b.
ENDIF

you can write the REM statement a lil more concisely:

REM 13 SATISFY $Tw == 5

let's see how this works. the SATISFY clause iterates through all the 13ths of successive months, until a trigger date is found whose day-of-week is Friday (== 5). if a valid date was found, we use the calculated trigger date to set up the next reminder. iconic. โœจ

we could also have written:

REM Fri SATISFY day(trigdate()) == 13

but this would result in more iterations, since "Fridays" occur more often than "13ths of the month."

here's another example: suppose you want to be reminded of something on the 15th of January, April, July, and October. you could make four separate reminders, or you could use:

REM 15 SATISFY [isany($Tm, 1, 4, 7, 10)] MSG 15th Reminder!

this technique of using one REM command to calculate a trigger date to be used by another command is quite powerful. for example, suppose you wanted to OMIT Labour day, which is the first Monday in September. you could use:

# Note: SATISFY 1 is an idiom for "do nothing"
REM Mon 1 Sept SATISFY 1
OMIT [trigdate()]
CAVEAT: this only omits the next Labour Day, not all Labour Days in the future. this could cause strange results, as the OMIT context can change depending on the current date. for example, if you use the following command after the above commands:
REM Mon AFTER msg hello
the result will not be as you expect. consider producing a calendar for September, 1992. Labour Day was on Monday, 7 September, 1992. however, when Remind gets around to calculating the trigger for Tuesday, 8 September, 1992, the OMIT command will now be omitting Labour Day for 1993, and the "Mon AFTER" command will not be triggered. (But see the description of SCANFROM in the section "DETAILS ABOUT TRIGGER COMPUTATION.")

it is probably best to stay away from computing OMIT trigger dates unless you keep these pitfalls in mind. fr fr. ๐Ÿ˜ญ

for versions of Remind starting from 03.00.07, you can include a MSG, RUN, etc. clause in a SATISFY clause like this:

REM trigger_stuff SATISFY [expr] MSG body

note that for this case only, the expr after SATISFY must be enclosed in square brackets. it must come after all the other components of the trigger, and immediately before the MSG, RUN, etc. keyword. if expr cannot be satisfied, then the reminder is not triggered.

so the "Friday the 13th" example can be expressed more compactly as:

REM 13 +2 SATISFY [$Tw == 5] MSG Friday the 13th is %b.

and you can trigger a reminder on Mondays, Wednesdays and Thursdays occurring on odd-numbered days of the month with this:

REM Mon Wed Thu SATISFY [$Td %2 ] MSG Here it is!!!

note that SATISFY and OMITFUNC can often be used to solve the same problem, though in different ways. sometimes a SATISFY is cleaner and sometimes an OMITFUNC; experiment and use whichever seems clearer. ๐ŸŽ€

โœจ POSSIBLY-UNCOMPUTABLE TRIGGERS โœจ

okay bestie so sometimes you're out here getting "Can't compute trigger" warnings for reminders where the trigger date genuinely cannot be computed, and you're like. girl. please. I know. That's what this keyword is for ๐Ÿ’…

Like say you want a reminder that fires on a Monday that is not a holiday, but only if the following Tuesday is a holiday. Very specific. Very demure. Here's how that looks:

REM Mon SKIP SATISFY [isomitted($T+1)] MSG Work between holidays

But here's the plot twist ๐Ÿ˜ญ if there are no Mondays after today's date that satisfy the condition, Remind will throw that "Can't compute trigger" error at you. To suppress it, you whip out the MAYBE-UNCOMPUTABLE keyword:

REM MAYBE-UNCOMPUTABLE Mon SKIP SATISFY [isomitted($T+1)] MSG Work between holidays

Now, real talk: it's almost never appropriate to use MAYBE-UNCOMPUTABLE. Like, it exists for those rare little occasions when it actually makes sense, and that's it. And if you use MAYBE-UNCOMPUTABLE inside the evaltrig() function, then untriggerable triggers return -1. For example:

SET a evaltrig("MAYBE-UNCOMPUTABLE Mon SKIP OMIT Mon")

will set a to -1. periodt ๐Ÿซถ


๐Ÿ› DEBUGGING REMINDER SCRIPTS ๐Ÿ›

So the command-line -d option is useful for debugging, no cap, but honestly? it's often overkill. Like if you turn on the -dx option for a reminder file with a bunch of complex expressions, you will get a huge amount of output. it's giving firehose energy ๐Ÿ’€

The DEBUG command lets you control the debugging flags under program control. The format is:

DEBUG [+flagson] [-flagsoff]

Flagson and flagsoff consist of strings of the characters "efhlmnpqstuvxz" that correspond to the debugging options discussed in the command-line options section. If preceded with a +, the corresponding group of debugging options is switched on. Otherwise, they are switched off. For example, you could use this sequence to debug a complicated expression:

DEBUG +x
set a very_complex_expression(many_args)
DEBUG -x

THE DUMPVARS COMMAND

The command DUMPVARS displays the values of variables in memory. Its format is:

DUMPVARS [-c] [var...]

If you supply a space-separated list of variable names, the corresponding variables are displayed. If you do not supply a list of variables, then all variables in memory are displayed. To dump a system variable, put its name in the list of variables to dump. And if you put a lone dollar sign in the list of variables to dump, then all system variables will be dumped ๐Ÿ’–

If you supply the -c flag, then any variable determined to be constant will have its value followed by <const>

THE ERRMSG COMMAND

The ERRMSG command has the following format:

ERRMSG body

The body is passed through the substitution filter (with an implicit trigger date of today()) and printed to the error output stream. Example:

IF !defined("critical_var")
     ERRMSG You must supply a value for "critical_var"
     EXIT
ENDIF

THE EXIT COMMAND

The above example also shows the use of the EXIT command. This causes an unconditional exit from script processing. Any queued timed reminders are discarded. And if you are in Calendar Mode (described next), then the calendar processing is aborted. bye bestie ๐Ÿ‘‹

If you supply an INT-type expression after the EXIT command, it is returned to the calling program as the exit status. Otherwise, an exit status of 99 is returned.

THE FLUSH COMMAND

This command simply consists of the word FLUSH on a line by itself. The command flushes the standard output and standard error streams used by Remind. This is not terribly useful to most people, but may be useful if you run Remind as a subprocess of another program, and want to use pipes for communication ๐ŸŒธ


๐ŸŒˆ AGENDA MODE JSON OUTPUT ๐ŸŒˆ

If you supply the --json argument, then Remind outputs JSON instead of the normal text output. The JSON output consists of a single JSON array of zero or more objects. There are three possible types of objects in the array:

  • banner โ€” The banner object, if present, will be the first</> object in the array. There will be at most one banner object. It contains a single key, banner, whose value is the banner that Remind would normally print in Agenda Mode.
  • noreminders โ€” The noreminders object, if present, will be the final</> object in the array. There will be at most one noreminders object. It contains a single key, noreminders, whose value is the phrase "No reminders.", possibly localized into a different language.
  • event โ€” All other objects in the array are event objects. They are JSON objects that contain all of the keys described in the rem2ps(1) man page section "CALENDAR ENTRIES". However, the calendar_body, plain_body and raw_body keys will not be present.

JSON output can be used by a front-end to display an attractive list of reminders in Agenda Mode. The "show today's reminders" feature of tkremind uses the JSON output. iconic behavior honestly ๐Ÿ‘‘


๐ŸŽ€ CALENDAR MODE ๐ŸŽ€

If you supply the -c, -s or -p command-line option, then Remind runs in "Calendar Mode." In this mode, Remind interprets the script repeatedly, performing one iteration through the whole file for each day in the calendar. Reminders that trigger are saved in internal buffers, and then inserted into the calendar in the appropriate places.

If you also supply the -a option, then Remind will not include timed reminders in the calendar.

The -p option is used in conjunction with the Rem2PS program to produce a calendar in PostScript format. For example, the following command will send PostScript code to standard output:

remind -p .reminders | rem2ps

You can print a PostScript calendar by piping this to the lpr command.

If you have a reminder script called .reminders, and you execute this command:

remind -c .reminders jan 1993

then Remind executes the script 31 times, once for each day in January. Each time it executes the script, it increments the value of today(). Any reminders whose trigger date matches today() are entered into the calendar.

MSG and CAL-type reminders, by default, have their entire body inserted into the calendar. RUN-type reminders are not normally inserted into the calendar. However, if you enclose a portion of the body in the %"..."% sequence, only that portion is inserted. For example, consider the following:

REM 6 Jan MSG %"Dianne's birthday%" is %b

In Agenda Mode, Remind would print "Dianne's birthday is today" on 6 January. However, in the Calendar Mode, only the text "Dianne's birthday" is inserted into the box for 6 January.

If you explicitly use the %"..."% sequence in a RUN-type reminder, then the text between the delimiters is inserted into the calendar. If you use the sequence %"%" in a MSG or CAL-type reminder, then no calendar entry is produced for that reminder.

PRESERVING VARIABLES

Because Remind iterates through the script for each day in the calendar, slow operations may severely reduce the speed of producing a calendar. not the vibe ๐Ÿ˜ญ

For example, suppose you set the variables "me" and "hostname" as follows:

SET me shell("whoami")
SET hostname shell("hostname")

Normally, Remind clears all variables between iterations in calendar mode and between iterations if a '*N' parameter was supplied on the command-line. However, if certain variables are slow to compute, and will not change between iterations, you can "preserve" their values with the PRESERVE command. Also, since function definitions are preserved between iterations, there is no need to redefine them on each iteration. Thus, you could use the following sequence:

IF ! defined("initialized")
     set initialized 1
     set me shell("whoami")
     set hostname shell("hostname")
     fset func(x) complex_expr
     preserve initialized me hostname
ENDIF

The operation is as follows: On the first iteration through the script, "initialized" is not defined. Thus, the commands between IF and ENDIF are executed. The PRESERVE command ensures that the values of initialized, me and hostname are preserved for subsequent iterations. On the next iteration, the commands are skipped, since initialized has remained defined. Thus, time-consuming operations that do not depend on the value of today() are done only once. efficiency queen โœจ

Most system variables (those whose names start with '$') are automatically preserved between calendar iterations.

Note that for efficiency, Remind caches the reminder script (and any INCLUDEd files) in memory when producing a calendar.

Timed reminders are sorted and placed into the calendar in time order. These are followed by non-timed reminders. Remind automatically places the time of timed reminders in the calendar according to the -b command-line option. Reminders in Calendar Mode are sorted as if the -g option had been used; you can change the sort order in Calendar Mode by explicitly using the -g option to specify a different order from the default.

REPEATED EXECUTION

If you supply a repeat parameter on the command line, and do not use the -c, -p, or -s options, Remind operates in a similar manner to Calendar Mode. It repeatedly executes the reminder script, incrementing today() with each iteration. The same rules about preserving variables and function definitions apply. Note that using repeat on the command line also enables the -q option and disables any -z option. As an example, if you want to see how Remind will behave for the next week, you can type:

remind .reminders '*7'

If you want to print the dates of the next 1000 days, use:

(echo 'banner %'; echo 'msg [today()]%') | remind - '*1000'

๐Ÿ’œ INITIALIZING VARIABLES ON THE COMMAND LINE ๐Ÿ’œ

The -i option is used to initialize variables on the Remind command line. The format is -ivar=expr, where expr is any valid expression. Note that you may have to use quotes or escapes to prevent the shell from interpreting special characters in expr. You can have as many -i options as you want on the command line, and they are processed in order. Thus, if a variable is defined in one -i option, it can be referred to by subsequent -i options.

Note that if you supply a date on the command line, it is not parsed until all options have been processed. Thus, if you use today() in any of the -i expressions, it will return the same value as realtoday() and not the date supplied on the command line. sneaky little detail fr fr

Any variables defined on the command line are preserved as with the PRESERVE command.

You should not have any spaces between the -i option and the equal sign; otherwise, strange variable names are created that can only be accessed with the value() or defined() functions. ๐Ÿ’€

You can also define a function on the command line by using:

-ifunc(args)=definition

Be sure to protect special characters from shell interpretation. ๐Ÿš

โœจ MORE ABOUT POSTSCRIPT โœจ

Okay bestie, listen up, because this is the part where you get to be โœจartisticโœจ.

The PS and PSFILE reminders pass PostScript code directly to the printer. The difference between them? PS-type reminders pass their body straight into the PostScript output (after the substitution filter has done its thing), while a PSFILE-type reminder's body should literally just be a filename. Then the Rem2PS program opens that file and drops its contents into the PostScript output. That's it. That's the whole vibe. ๐ŸŽ€

The PostScript-type reminders for any given day get included in the PostScript output in sorted order of priority. And โš ๏ธ heads up โš ๏ธ โ€” the order of PostScript commands has a major impact on how the calendars actually look. Like, say you've got PostScript code to shade a calendar box, and also code to draw a moon symbol. If the moon symbol code gets placed in the calendar first, the shading will straight-up obliterate it. ๐Ÿ’€

So for this reason, you should not give PS or PSFILE-type reminders priorities. Instead, make sure they show up in the reminder script in the correct order. PostScript code should draw objects working from the background to the foreground, so the foreground stuff properly overlays the background stuff. And if you do prioritize these reminders and run the script using descending sort order for priorities? The PostScript output will not work. Fr fr. ๐Ÿ™ˆ

All of the PostScript code for a particular date is enclosed in a save-restore pair. But โ€” plot twist โ€” if several PostScript-type reminders get triggered for a single day, each individual section of PostScript is not enclosed in a save-restore pair. Instead, the entire body of included PostScript is enclosed. Iconic behavior, honestly. ๐Ÿ‘‘

PostScript-type reminders are executed by the PostScript printer before any regular calendar entries. So regular calendar entries will overlay the PostScript-type reminders, which means you can create shaded or graphical backgrounds for particular days. Ate. ๐Ÿ’…

Before it runs your PostScript code, the origin of the PostScript coordinate system gets positioned to the bottom left-hand corner of the "box" in the calendar representing today(). That location is exactly in the middle of the intersection of the bottom and left black lines delineating the box โ€” so you may have to account for the thickness of those lines when you're calculating positions. The more you know! โญ

Several PostScript variables are available to the PostScript code you supply. All distance and size variables are in PostScript units (1/72 inch). The variables are:

  • LineWidth โ€” the width of the black grid lines making up the calendar.
  • Border โ€” the border between the center of the grid lines and the space used to print calendar entries. This border is normally blank space.
  • BoxWidth and BoxHeight โ€” the width and height of the calendar box, from center-to-center of the black gridlines.
  • InBoxHeight โ€” the height from the center of the bottom black gridline to the top of the regular calendar entry area. The space from here to the top of the box is used only to draw the day number.
  • /DayFont, /EntryFont, /SmallFont, /TitleFont and /HeadFont โ€” the fonts used to draw the day numbers, the calendar entries, the small calendars, the calendar title (month, year) and the day-of-the-week headings, respectively.
  • DaySize, EntrySize, TitleSize and HeadSize โ€” the sizes of the above fonts. (The size of the small calendar font is not defined here.) For example, if you wanted to print the Hebrew date next to the regular day number in the calendar, use:
REM PS Border BoxHeight Border sub DaySize sub moveto \
   /DayFont findfont DaySize scalefont setfont \
   ([hebday(today())] [hebmon(today())]) show

See how /DayFont and DaySize are being used there? Yeah. Notice it. ๐ŸŒธ

Note that if you supply PostScript code, it is possible to produce invalid PostScript files. Always test your PostScript thoroughly with a PostScript viewer before sending it to the printer. And you should not use any document structuring comments in your PostScript code.

๐ŸŒ™ DAEMON MODE ๐ŸŒ™

If you use the -z command-line option, Remind runs in "daemon mode". In this mode, no "normal" reminders are issued. Instead, only timed reminders get collected and queued, and then they're issued whenever they reach their trigger time. She just sits there. Waiting. Patiently. ๐Ÿฆ‹

In addition, Remind wakes up every few minutes to check the modification date on the reminder script (the filename supplied on the command line). If Remind detects that the script has changed, it re-executes itself in daemon mode and interprets the changed script. And if Remind was compiled with support for inotify(7), then โ€” if the command-line reminder script is really a directory โ€” Remind also re-executes itself if any of the files in the directory is changed. Obsessed with the attention to detail tbh. ๐Ÿ’–

In daemon mode, Remind also re-reads the remind script when it detects that the system date has changed.

In daemon mode, Remind acts as if the -f option had been used, so to run in daemon mode in the background, use:

remind -z .reminders &

If you use sh or bash, you may have to use the nohup command to make sure the daemon doesn't get killed when you log out. Protect her at all costs. ๐Ÿซถ


๐Ÿงน PURGE MODE ๐Ÿงน

If you supply the -j command-line option, Remind runs in purge mode. In this mode, it tries to purge expired reminders from your reminder files. Spring cleaning, but for your schedule. ๐ŸŒˆ

In purge mode, Remind reads your reminder file and creates a new file by appending .purged to the original file name. And note โ€” Remind never edits your original file. It always creates a new .purged file. Your og file stays untouched, bestie. ๐Ÿ’œ

If you invoke Remind against a directory instead of a file, then a .purged file is created for each *.rem file in the directory.

Normally, Remind does not create .purged files for INCLUDEd files. However, if you supply a numeric argument after -j, then Remind will create .purged files for the specified level of INCLUDE. For example, if you invoke Remind with the argument -j2, then .purged files will be created for the file (or directory) specified on the command line, any files included by them, and any files included by those files. However, .purged files will not be created for third-or-higher level INCLUDE files. There's a cutoff. Know it. โœ‚๏ธ

Determining which reminders have expired is extremely tricky. Remind does its best, but you should always compare the .purged file to the original file and hand-merge the changes back in. Do not skip this step. I'm so serious. ๐Ÿ˜ญ

Remind annotates the .purged file as follows:

An expired reminder is prefixed with: #!P: Expired:

In situations where Remind cannot reliably determine that something was expired, you may see the following comments inserted before the problematic line:

#!P: Cannot purge SATISFY-type reminders

#!P: The next IF evaluated false...
#!P: REM statements in IF block not checked for purging.

#!P: The previous IF evaluated true.
#!P: REM statements in ELSE block not checked for purging

#!P: The next IFTRIG did not trigger.
#!P: REM statements in IFTRIG block not checked for purging.

#!P: Next line has expired, but contains expression...  please verify

#!P: Next line may have expired, but contains non-constant expression
#!P: or a relative SCANFROM clause

#!P! Could not parse next line: Some-Error-Message-Here

#!P! Problem calculating trigger date

Remind always annotates .purged files with lines beginning with #!P. If such lines are encountered in the original file, they are not copied to the .purged file. ๐ŸŽ€

If you use the "Hush" flag -h in conjunction with the "Purge" flag -j, then Remind does not create any of the diagnostic comments listed above. Instead, the only change it makes to the .purged file is to mark expired reminders with #!P: Expired. Quiet mode. ๐Ÿคซโœจ

โœจ NON-CONSTANT EXPRESSIONS โœจ

okay bestie, this one's lowkey important if you're using Purge Mode ๐Ÿ’…

In Purge Mode, Remind will not mark a REM statement as expired if its trigger specification contains a non-constant expression. And what's that, you ask? A non-constant expression is defined as one whose value might differ from run to run โ€” usually because it depends on the current date, but also if it depends on something from the environment (like the output of the shell() function, bestie, that one's giving chaos energy ๐ŸŒช๏ธ).

The use of any of the following in an expression causes Remind to consider it non-constant:

  • A global variable that has been assigned the result of a non-constant expression, or that has been assigned a value in a non-constant context (we'll get to that, stay with me ๐Ÿซถ)
  • A system variable
  • Certain built-in functions that depend on the current date (for example, today()) or the environment (for example, shell())

And in addition, for the purposes of safely expiring reminders in Purge Mode, Remind also considers the following to be non-constant:

  • The use of an OMITFUNC
  • The use of a relative SCANFROM

Whenever a variable is assigned a value, Remind tracks whether or not the expression whose value it was assigned is constant or non-constant. And additionally, variables that are assigned in a non-constant context are always assumed to be non-constant. A non-constant context is the code in the scope of an IF statement where the IF expression is non-constant. it's giving "we don't know what timeline we're in" ๐Ÿ˜ญ

Here are some examples that should make things clear:

SET d '2025-06-01'        # d is constant
REM [d] MSG Hello!        # eligible for purging

SET d today() - 3         # d is non-constant
REM [d] MSG Hello!        # not eligible for purging

IF wkdaynum(today()) == 3
    set d '2025-06-01'    # d is non-constant
ELSE
    set d '2026-01-01'    # d is non-constant
ENDIF

SET d '2025-06-01'        # d is constant
IF today() > today() + 3  # This branch is never taken, but...
    SET d '2029-01-01'    # d is still marked non-constant
ENDIF

# Although here d is still '2025-06-01', it is marked
# non-constant because as far as Remind is concerned,
# the IF body *might* have been executed depending on today()

Note that within the IF...ENDIF scope, any assignments are non-constant, because the code flow depends on today's date, which could change in subsequent Remind runs. So if you want to force a variable to be treated as constant, no matter what, then use the following just before you use the variable:

SET var const(var)

Variables initialized on the command-line with the -i flag are always considered to be non-constant. no exceptions, periodt ๐Ÿ‘‘

If you have an expired reminder that for some reason you never want purged, simply use the built-in function nonconst somewhere in the trigger. For example:

REM 1992-01-01 MSG This will be purged after Jan 1 1992
REM [nonconst('1992-01-01')] MSG This will never be purged

REM Wed UNTIL 1993-12-31 MSG This will be purged after 1993
REM Wed UNTIL [nonconst('1993-12-31')] MSG Never purged

The n debugging flag prints a message to standard error whenever Remind decides that an expression is non-constant. heads up tho ๐Ÿšจ this can produce a large amount of output, so if you want to find out why Remind considers a specific expression to be non-constant, it's best to use DEBUG +n before it and DEBUG -n after it to limit the amount of output. little window of chaos, you're welcome ๐Ÿ’–


๐ŸŒˆ SORTING REMINDERS ๐ŸŒˆ

The -g option causes Remind to sort reminders by trigger date, time and priority before issuing them. Note that reminders are still calculated in the order encountered in the script โ€” no cap. However, rather than being issued immediately, they are saved in an internal buffer ๐Ÿงบ. When Remind has finished processing the script, it issues the saved reminders in sorted order. it's giving "patience, bestie" โœจ

The -g option can be followed by up to four characters that must all be "a" or "d". Here's the breakdown:

  • The first character specifies the sort order by trigger date (ascending or descending)
  • The second character specifies the sort order by trigger time
  • The third character specifies the sort order by priority
  • If the fourth character is "d", the untimed reminders are sorted before timed reminders

The default is to sort all fields in ascending order and to sort untimed reminders after timed reminders.

In ascending order, reminders are issued with the most imminent first. Descending order is the reverse. Reminders are always sorted by trigger date, and reminders with the same trigger date are then sorted by trigger time. If two reminders have the same date and time, then the priority is used to break ties. Reminders with the same date, time and priority are issued in the order they were encountered.

You can define a user-defined function called SORTBANNER that takes one DATE-type argument. In sort mode, the following sequence happens:

If Remind notices that the next reminder to issue has a different trigger date from the previous one (or if it is the first one to be issued), then SORTBANNER is called with the trigger date as its argument. The result is coerced to a string, and passed through the substitution filter with the appropriate trigger date. The result is then displayed. iconic behavior fr fr ๐Ÿ‘‘

Here's an example โ€” consider the following fragment:

# Switch off the normal banner
BANNER %
REM 11 March 1993 ++1 MSG Not so important
REM 17 March 1993 ++7 MSG Way in the future
REM 10 March 1993 MSG Important Reminder
REM 11 March 1993 ++1 MSG Not so important - B
FSET sortbanner(x) iif(x == today(), \
     "***** THINGS TO DO TODAY *****", \
     "----- Things to do %b -----")

Running this with the -gaa option on 10 March 1993 produces the following output:

***** THINGS TO DO TODAY *****

Important Reminder

----- Things to do tomorrow -----

Not so important

Not so important - B

----- Things to do in 7 days' time -----

Way in the future

You can use the args() built-in function to determine whether or not SORTBANNER has been defined. (This could be used, for example, to provide a default definition for SORTBANNER in a system-wide file included at the end of the user's file.) Here's an example:

# Create a default sortbanner function if it hasn't already
# been defined
if args("sortbanner") != 1
     fset sortbanner(x) "--- Things to do %b ---"
endif

๐Ÿ’– MSGPREFIX() AND MSGSUFFIX() ๐Ÿ’–

You can define two functions in your script called msgprefix() and msgsuffix(). They should each accept one argument, a number from 0 to 9999.

In Agenda Mode, for MSG- and MSF-type reminders, the following sequence occurs when Remind triggers a reminder:

  • If msgprefix() is defined, it is evaluated with the priority of the reminder as its argument. The result is printed. It is not passed through the substitution filter.
  • The body of the reminder is printed.
  • If msgsuffix() is defined, it is evaluated with the priority of the reminder as its argument. The result is printed. It is not passed through the substitution filter.

Here's an example: The following definition causes priority-0 reminders to be preceded by "URGENT", and priority-6000 reminders to be preceded by "(not important)".

fset msgprefix(x) iif(x==0, "URGENT: ", \
     x==6000, "(not important) ", "")

In Calendar Mode (with the -c, -s or -p options), an analogous pair of functions named calprefix() and calsuffix() can be defined. They work with all reminders that produce an entry in the calendar (i.e., CAL- and possibly RUN-type reminders as well as MSG-type reminders.) ๐ŸŒธ

๐Ÿ“ NOTES ๐Ÿ“

Normally, the body of a reminder is followed by a carriage return. Thus, the results of msgsuffix() will appear on the next line. If you don't want this, make sure the output of msgsuffix begins with a backspace. This places the suffix before rather than after the carriage return. (The backspace character itself is stripped out.) Here is an example:

FSET msgsuffix(x) char(8) + " - suffix on same line"

If Remind has problems evaluating msgprefix(), msgsuffix() or sortbanner(), you will see a lot of error messages. For an example of this, define the following:

fset msgprefix(x) x/0
๐Ÿ’€ yeah bestie, dividing by zero is not the vibe. this will absolutely flood your terminal, you've been warned.

๐Ÿฆ‹ COMPILE-TIME SUPPORT FOR OTHER LANGUAGES ๐Ÿฆ‹

Remind used to support compile-time localization to other languages, but no longer does. All localization is now done at run-time. glow-up era โœจ


๐ŸŽ€ RUN-TIME SUPPORT FOR OTHER LANGUAGES ๐ŸŽ€

Remind has run-time support for other languages, and compile-time support has been removed in favour of run-time support.

A number of system variables let you translate various phrases to other languages. These system variables are:

  • $Monday, $Tuesday, $Wednesday, $Thursday, $Friday, $Saturday, $Sunday โ€” Set each of these system variables to a string representing the corresponding day's name in your language. Strings must be valid UTF-8 strings.
  • $January, $February, $March, $April, $May, $June, $July, $August, $September, $October, $November, $December โ€” Set each of these system variables to a string representing the corresponding month's name in your language. Strings must be valid UTF-8 strings.
  • $Ago, $Am, $And, $At, $Hour, $Is, $Minute, $Now, $On, $Pm, $Today, $Tomorrow, $Was โ€” Set each of these system variables to the translation of the corresponding English word into your language. Note that $Am and $Pm should be the translations of "AM" and "PM" (morning and afternoon time indicators) respectively.
  • $Hplu, $Mplu โ€” Set these to the suffix to add to the word for "hour" and "minute" to make them plural. In English, both would be set to "s".
  • $Fromnow โ€” Set this to the translation of the English phrase "from now"

Note that if you set any of the language-related system variables, they should be set in a section of your script that always is evaluated. If you set them inside an IF statement, for example, results are unpredictable. ๐Ÿšจ don't do it bestie, it's giving undefined behavior energy.

Note also that the Rem2PS back-end does not support the full range of UTF-8 characters. The TkRemind, rem2html and rem2pdf back-ends all do support the full UTF-8 range. so if you're going full multilingual emoji-adjacent vibes, pick your back-end wisely ๐Ÿ’…๐ŸŒˆ

๐Ÿ’… RUN-TIME MODIFICATION OF THE SUBSTITUTION FILTER โœจ

okay bestie so like โ€” the system variables we were just yapping about? they're lowkey not enough to actually translate Remind's output properly. some languages have the most extra rules for AM vs PM times, and others are out here doing gymnastics for plurals. so Remind is like "fine, I'll let you define functions that change how the substitution filter behaves while it's running." the functions are:

  • subst_ampm(h) โ€” gets handed one single integer, an hour from 0 to 23. it should return a string that says "AM" or "PM" or honestly whatever finer gradations your language needs. do your thing ๐ŸŽ€
  • subst_ordinal(d) โ€” handed one single integer, a day of the month from 1 to 31. it returns a string that gets slapped onto the day number to make it an ordinal. in English, for example, the function might return "st", "nd", "rd" or "th", depending on d. iconic behavior fr fr.
  • subst_N(alt, date, time) โ€” this is actually a whole family of functions, where N is a letter or number. it completely overrides the substitution sequence %N. the three arguments are: alt, an integer which โ€” if it's non-zero โ€” means the alternate-mode substitution sequence %*N got encountered; date, the trigger date of the reminder; and time, the trigger time.
  • subst_Nx(alt, date, time) โ€” again, a family of functions. same vibe as the subst_N crew except it's only called if date is two or more days away from today(). super useful when you don't wanna override the "today" or "tomorrow" output for most substitution sequences.

here's an example of how you might customize your substitution filter ๐Ÿ’–. say you wanna change the %b sequence to substitute "the day after tomorrow" for an event two days from now. you could do this:

FSET subst_bx(a,d,t) iif(d==today()+2, "the day after tomorrow", \
                         "in " + (d-today()) + " days' time")
REM [today()+3] ++3 MSG Event 1 is %b%
REM [today()+2] ++3 MSG Event 2 is %b%
REM [today()+1] ++3 MSG Event 3 is %b%
REM [today()]   ++3 MSG Event 4 is %b%

the output of this script is:

Event 1 is in 3 days' time
Event 2 is the day after tomorrow
Event 3 is tomorrow
Event 4 is today

notice how Event 2's wording got changed from the normal "in 2 days' time", and also notice that the "tomorrow" and "today" events used the normal substitution โ€” subst_bx doesn't get called for trigger days of today or tomorrow. no cap. ๐Ÿฆ‹

as a special case, if a subst_Nx or subst_N function returns the integer zero, then the normal substitution mechanism kicks in. so the previous example could've been written more simply as:

FSET subst_bx(a,d,t) iif(d==today()+2, "the day after tomorrow", 0)

you can override substitution sequences that aren't alphanumeric like this:

  • override %: with subst_colon
  • override %! with subst_bang
  • override %? with subst_question
  • override %@ with subst_at
  • override %# with subst_hash

and you can define your own substitution sequences on top of the built-in ones like this: if you define a function named subst_name(alt, date, time), then the sequence %{name} calls the function with alt set to 0 and date and time to the trigger date and time, respectively. the %{name} sequence gets replaced with whatever the function returns. the sequence %*{name} is similar, but calls the function with alt set to 1. โœจ

if you use a %{name} sequence and the function subst_name isn't defined or returns an error, then %{name} gets replaced with the empty string. ๐Ÿ™ˆ

note that when Remind invokes any callback function for a substitution sequence, RUN will be disabled. ๐Ÿ’€

๐ŸŒธ THE TRANSLATION TABLE ๐ŸŒธ

to help with localizing reminder files, Remind keeps a table of translations. it's literally just a lookup table mapping one string (the original string) to a new string (the translated string). when Remind starts executing, the translation table is empty. brand new, zero notes.

to add a message to the translation table, use the TRANSLATE command (which may be abbreviated to TRANS). the TRANSLATE command must be followed by two quoted strings, separated from each other and from the command by whitespace. for example, a Dutch language file might contain something like this:

TRANSLATE "New Moon" "Nieuwe maan"
TRANSLATE "First Quarter" "Eerste kwartier"
TRANSLATE "Full Moon" "Volle maan"
TRANSLATE "Last Quarter" "Laatste kwartier"

to actually use the translation table, make use of the _ built-in function, like so:

REM NOQUEUE [moondatetime(0)] MSG [_("New Moon")] (%2)
REM NOQUEUE [moondatetime(1)] MSG [_("First Quarter")] (%2)
REM NOQUEUE [moondatetime(2)] MSG [_("Full Moon")] (%2)
REM NOQUEUE [moondatetime(3)] MSG [_("Last Quarter")] (%2)

by using TRANSLATE and _ judiciously, you can make your reminder files easy to translate. chef's kiss ๐Ÿ‘‘

TRANSLATE has four additional forms: if it's followed by one quoted string instead of two, then Remind deletes the translation table entry for that string. if it's followed by the keyword DUMP, then Remind dumps all translation table entries to standard output. and if it's followed by CLEAR, then Remind deletes all of the translation table entries. poof. gone. ๐Ÿ’…

the fourth form, TRANSLATE GENERATE, dumps all of the strings that can be localized (as a series of TRANSLATE commands) to standard output. strings that are already localized get output with their localization; strings that aren't localized get output as:

TRANSLATE "untranslated" ""

if you wanna add a new language, you can obtain a skeleton translation file by running:

echo "TRANSLATE GENERATE" | remind -h - > /tmp/skeleton.rem

if you've got an existing language file that's missing some translations, you can update it by running:

(echo INCLUDE mylang.rem; echo TRANSLATE GENERATE) | \
    remind -h - > /tmp/mylang-update.rem

and then editing mylang-update.rem to add in the missing translations. easy peasy ๐ŸŽ€

if you've got some reminder scripts that use the _() built-in function or %(...) substitution sequence, you can generate a list of needed TRANSLATE commands by running:

remind -q -n -dq myscript.rem 2>&1 | grep ^TRANSLATE | sort | uniq
note that if you SET various translation-related system variables such as $Monday, $December, $Ago, etc, then Remind also makes a corresponding translation table entry automatically. this is done for all of the translation-related system variables except for $Hplu and $Mplu. ๐Ÿ‘€

the converse applies too; creating a translation table for "December" automatically sets $December. and if you invoke TRANSLATE CLEAR, then all translation-related system variables get set to their default values as well. it's giving mutual.

the translation table always contains a special entry LANGID whose default value is en. translators are encouraged to add a LANGID entry in their language files; the value should be the two-characters ISO 639 language code. ๐ŸŒˆ

for example, if you write a translation file for the Dutch language, add this line:

TRANSLATE "LANGID" "nl"

scripts can use _("LANGID") to query the translation language that's in effect. cute right?

the _() function uses the following procedure to obtain the translation for a string:

  1. Look for an exact match. If found, return.
  2. If the original string had an upper-case letter, search for the all-lower-case equivalent. If found, make the first letter of the result upper-case and return.
  3. If the original string started with a lower-case letter, search for an equivalent whose first letter is upper-case and the rest lower-case. If found, make the first letter of the result lower-case and return.
  4. No translation was found. Return the original string.

๐Ÿฆ‹ LANGUAGE PACKS ๐Ÿฆ‹

Remind ships with a number of language packs, which are simply reminder scripts located in [$SysInclude]/lang. the currently-shipping language packs are:

da.rem (Danish), de.rem (German), es.rem (Spanish), fr.rem (French), is.rem (Icelandic), it.rem (Italian), nl.rem (Dutch), no.rem (Norwegian), pl.rem (Polish), pt.rem (Portuguese) and ro.rem (Romanian). a whole squad fr ๐Ÿ’œ

to use a language pack (in this example, de.rem), simply place this at the top of your reminders file:

SYSINCLUDE lang/de.rem

if you want Remind to try to find the language pack appropriate for your locale settings, use:

SYSINCLUDE lang/auto.rem

you're encouraged to study the language packs to see how to translate Remind into additional languages. go off, polyglot bestie ๐ŸŒธโœจ

๐Ÿ’œ THE HEBREW CALENDAR ๐Ÿ’œ

okay bestie, listen โ€” Remind has support for the Hebrew calendar, which is a luni-solar calendar (yes, both, it's doing the most and honestly? respect). This means you can build reminders for Jewish holidays, jahrzeits (anniversaries of deaths) and smachot (joyous occasions.) ๐Ÿ•ฏ๏ธ๐ŸŽ‰


๐ŸŒ™ THE HEBREW YEAR ๐ŸŒ™

The Hebrew year has 12 months, alternately 30 and 29 days long. The months are: Tishrey, Heshvan, Kislev, Tevet, Shvat, Adar, Nisan, Iyar, Sivan, Tamuz, Av and Elul. And if you're in a UTF-8 locale, you can also use the UTF-8-encoded Hebrew spellings for the month names, namely:

ืชืฉืจื™, ื—ืฉื•ื•ืŸ, ื›ืกืœื•, ื˜ื‘ืช, ืฉื‘ื˜, ืื“ืจ, ื ื™ืกืŸ, ืื™ื™ืจ, ืกื™ื•ืŸ, ืชืžื•ื–, ืื‘, ืืœื•ืœ.

In a cycle of 19 years, there are 7 leap years, being years 3, 6, 8, 11, 14, 17 and 19 of the cycle. In a leap year, an extra month of 30 days is added before Adar. The two Adars are called Adar A and Adar B, or in Hebrew, 'ืื“ืจ ื and 'ืื“ืจ ื‘.

Remind also permits the following alternative spellings for Hebrew month names:

  • Tishrey โ€” Can also be spelled Tishri or Tishrei
  • Heshvan โ€” Can also be spelled Cheshvan or Kheshvan
  • Shvat โ€” Can also be spelled Shevat
  • Tamuz โ€” Can also be spelled Tammuz
  • Adar A โ€” Can also be spelled Adar 1, Adar I, ืื“ืจ ื or ืื“ืจ 1.
  • Adar B โ€” Can also be spelled Adar 2, Adar II, ืื“ืจ ื‘ or ืื“ืจ 2.
  • Iyar โ€” Can also be spelled Iyyar.

For certain religious reasons, the year cannot start on a Sunday, Wednesday or Friday. To adjust for this, a day is taken off Kislev or added to Heshvan. Thus, a regular year can have from 353 to 355 days, and a leap year from 383 to 385.

When Kislev or Heshvan is short, it is called chaser, or lacking. When it is long, it is called shalem, or full. ๐Ÿ“

ngl there's a little catch here: the Jewish date changes at sunset. But Remind will change the date at midnight, not sunset. So in the period between sunset and midnight, Remind will be a day earlier than the true Jewish date. This should not be much of a problem in practice. ๐Ÿ˜ญ

The computations for the Jewish calendar were based on the program "hdate" written by Amos Shapir of the Hebrew University of Jerusalem, Israel. He also supplied the preceding explanation of the calendar. ๐Ÿ‘‘


โœจ HEBREW DATE FUNCTIONS โœจ

  • hebday(d_date) โ€” Returns the day of the Hebrew month corresponding to the date parameter. For example, 12 April 1993 corresponds to 21 Nisan 5753. Thus, hebday('1993/04/12') returns 21.
  • hebmon(d_date) โ€” Returns the name of the Hebrew month corresponding to date. For example, hebmon('1993/04/12') returns "Nisan".
  • ivritmon(d_date) โ€” Returns the name of the Hebrew month corresponding to date, in UTF-8-encoded Hebrew script. For example, ivritmon('1993/04/12') returns "ื ื™ืกืŸ".
  • hebyear(d_date) โ€” Returns the Hebrew year corresponding to date. For example, hebyear('1993/04/12') returns 5753.
  • hebdate(i_day, s_hebmon [,id_yrstart [,i_jahr [,i_aflag]]]) โ€” The hebdate() function is the most complex of the Hebrew support functions. It can take from 2 to 5 arguments. It returns a DATE corresponding to the Hebrew date.

okay so let's unpack hebdate() because she's a lot ๐Ÿ’…

The day parameter can range from 1 to 30, and specifies the day of the Hebrew month. The hebmon parameter is a string that must name one of the Hebrew months specified above. Note that the month must be spelled out in full, and use either the English transliteration shown previously, or the Hebrew spelling encoded in UTF-8. You can also specify "Adar A" and "Adar B." Month names are not case-sensitive.

The yrstart parameter can either be a DATE or an INT. If it is a DATE, then the hebdate() scans for the first Hebrew date on or after that date. For example:

hebdate(15, "Nisan", '1990/01/01')

returns 1990/03/30, because that is the first occurrence of 15 Nisan on or after 1 January 1990.

If yrstart is an INT, it is interpreted as a Hebrew year. Thus:

hebdate(22, "Kislev", 5756)

returns 1995/12/15, because that date corresponds to 22 Kislev, 5756. Note that none of the Hebrew date functions will work with dates outside Remind's normal range for dates. ๐Ÿšง

If yrstart is not supplied, it defaults to today().

The jahr modifies the behaviour of hebdate() as follows:

If jahr is 0 (the default), then hebdate() keeps scanning until it finds a date that exactly satisfies the other parameters. For example:

hebdate(30, "Adar A", 1993/01/01)

returns 1995/03/02, corresponding to 30 Adar A, 5755, because that is the next occurrence of 30 Adar A after 1 January, 1993. This behaviour is appropriate for Purim Katan, which only appears in leap years. ๐ŸŽญ

If jahr is 1, then the date is modified as follows:

  • 30 Heshvan is converted to 1 Kislev in years when Heshvan is chaser
  • 30 Kislev is converted to 1 Tevet in years when Kislev is chaser
  • 30 Adar A is converted to 1 Nisan in non-leapyears
  • Other dates in Adar A are moved to the corresponding day in Adar in non-leapyears

This behaviour is appropriate for smachot (joyous occasions) and for some jahrzeits โ€” see "JAHRZEITS."

if jahr is 2, then the date is modified as follows:

  • 30 Kislev and 30 Heshvan are converted to 29 Kislev and 29 Heshvan, respectively, if the month is chaser
  • 30 Adar A is converted to 30 Shvat in non-leapyears
  • Other dates in Adar A are moved to the corresponding day in Adar in non-leapyears

if jahr is not 0, 1, or 2, it is interpreted as a Hebrew year, and the behaviour is calculated as described in the next section, "JAHRZEITS."

The aflag parameter modifies the behaviour of the function for dates in Adar during leap years. The aflag is only used if yrstart is a DATE type.

The aflag only affects date calculations if hebmon is specified as "Adar". In leap years, the following algorithm is followed:

  • If aflag is 0, then the date is triggered in Adar B. This is the default.
  • If aflag is 1, then the date is triggered in Adar A. This may be appropriate for jahrzeits in the Ashkenazi tradition; consult a rabbi.
  • If aflag is 2, then the date is triggered in both Adar A and Adar B of a leap year. Some Ashkenazim perform jahrzeit in both Adar A and Adar B.

๐Ÿ•ฏ๏ธ JAHRZEITS ๐Ÿ•ฏ๏ธ

A jahrzeit is a yearly commemoration of someone's death. It normally takes place on the anniversary of the death, but may be delayed if burial is delayed โ€” consult a rabbi for more information.

In addition, because some months change length, it is not obvious which day the anniversary of a death is. The following rules are used:

  • If the death occurred on 30 Heshvan, and Heshvan in the year after the death is chaser, then the jahrzeit is observed on 29 Heshvan in years when Heshvan is chaser. Otherwise, the jahrzeit is observed on 1 Kislev when Heshvan is chaser.
  • If the death occurred on 30 Kislev, and Kislev in the year after the death is chaser, then the jahrzeit is observed on 29 Kislev in years when Kislev is chaser. Otherwise, the jahrzeit is observed on 1 Tevet when Kislev is chaser.
  • If the death occurred on 1-29 Adar A, it is observed on 1-29 Adar in non-leapyears.
  • If the death occurred on 30 Adar A, it is observed on 30 Shvat in a non-leapyear.

Specifying a Hebrew year for the jahr parameter causes the correct behaviour to be selected for a death in that year. You may also have to specify aflag, depending on your tradition.

The jahrzeit information was supplied by Frank Yellin, who quoted "The Comprehensive Hebrew Calendar" by Arthur Spier, and "Calendrical Calculations" by E. M. Reingold and Nachum Dershowitz. ๐Ÿ“š๐Ÿซถ

๐Ÿ’ซ OUT-OF-BAND REMINDERS ๐Ÿ’ซ

okay so bestie, the SPECIAL keyword is the secret little tunnel ๐Ÿ•ณ๏ธ that sends "out-of-band" info to Remind backends, like tkremind or Rem2PS. They only ever do their thing when you're piping data from a remind -p line. (Heads up though: the COLOR special is the exception ๐Ÿ‘€ โ€” it works a lot like MSG when the -p option isn't supplied.)

Every backend has its own fave SPECIALs, but there are four that all backends should attempt to support. As of right now, they're supported by Rem2PS, tkremind and rem2html. slay ๐Ÿ’…


SHADE is the glow-up replacement for the psshade() function. Use it like this:

     REM Sat Sun SPECIAL SHADE 128
     REM Mon SPECIAL SHADE 255 0 0

So the SHADE keyword is followed by either one or three numbers, and they all live between 0 and 255. Give it one number and it's read as a grey-scale value, from black (0) all the way to white (255). Give it three numbers and they're RGB components, from minimum (0) to maximum (255). The example up there shades weekends a fairly dark grey and makes Mondays a fully-saturated red ๐Ÿ”ด. (These shadings show up in calendars produced by Rem2PS, tkremind and rem2html.)

MOON is the replacement for the psmoon() function. Use it like this:

     REM [moondate(0)] SPECIAL MOON 0
     REM [moondate(1)] SPECIAL MOON 1
     REM [moondate(2)] SPECIAL MOON 2
     REM [moondate(3)] SPECIAL MOON 3

These draw little moons ๐ŸŒ™ on the various calendars. The complete syntax of the MOON special goes like this:

     ... SPECIAL MOON phase moonsize fontsize msg

phase is a number from 0 to 3, where 0 is a new moon, 1 is the first quarter, 2 is a full moon and 3 is the last quarter. ๐ŸŒ‘๐ŸŒ“๐ŸŒ•๐ŸŒ—

moonsize is the diameter, in PostScript units, of the moon you want drawn. If you omit it, or pass it as -1, the backend just picks an appropriate size itself. no stress.

fontsize is the font size in PostScript units of the msg.

Msg is additional text that gets placed near the moon glyph.

note that only the Rem2PS backend supports moonsize and fontsize; the other backends use fixed sizes. ๐Ÿ˜ญ

COLOR lets you drop colored reminders right into the calendar. Use it like this:

     REM ... SPECIAL COLOR 255 0 0 This is a bright red reminder
     REM ... SPECIAL COLOR 0 128 0 This is a dark green reminder

You can spell it the American way (COLOR) or the British way (COLOUR) โ€” this manual is gonna use the American way. Immediately after COLOR should come three decimal numbers ranging from 0 to 255, specifying red, green and blue intensities, respectively. The rest of the line is the text you want to put in the calendar. โœจ

The COLOR special is "doubly special" โ€” because in Agenda Mode, remind treats a COLOR special just like a MSG-type reminder. Also, if you invoke Remind with -@[n], then it approximates SPECIAL COLOR reminders on your terminal. iconic behaviour honestly.

See also the documentation of the $DefaultColor system variable in the section "SYSTEM VARIABLES".

WEEK lets you place annotations like the week number into the calendar. For example, this would number each Monday with the ISO 8601 week number. In this example the week number shows up like "(Wn)", but you can put whatever text you like after the WEEK keyword. ๐Ÿ—“๏ธ

     REM Monday SPECIAL WEEK (W[weekno()])

๐ŸŽ€ FORMATTED REMINDERS ๐ŸŽ€

If you use the FMT keyword instead of a MSG keyword in a REM command, then Remind treats the body of the reminder as being written in a Remind-specific markup language. (You can also use SPECIAL FORMATTED instead of FMT โ€” the FMT one is just syntactical sugar for it. ๐Ÿฌ)

That markup language is a subset of the Pango markup language described at https://docs.gtk.org/Pango/pango_markup.html. It looks a lot like the Pango language and a lot like HTML, but bestie, it is neither of those. ๐Ÿ™ˆ

Just like with HTML, the FMT markup language uses tags wrapped in angle brackets. The three supported tags are:

  • <b> โ€” makes the text bold until the matching </b> closing tag shows up.
  • <i> โ€” makes the text italic until the matching </i> closing tag shows up.
  • <u> โ€” underlines the text until the corresponding </s> closing tag is encountered.
  • <s> โ€” strikes a line through the text until the corresponding </s> closing tag is encountered.
  • <span color="#ABCDEF" bgcolor="#ABCDEF"> โ€” colors the text according to the specification given by the six hexadecimal digits ABCDEF. Instead of color, you can also use fgcolor or foreground. And instead of bgcolor, you can specify background. A closing </span> tag terminates the run of colored text. You may supply either the foreground or the background attribute, or both in a single <span> tag. ๐ŸŒˆ

But there are some differences from HTML, so don't get it twisted:

  • Tag names must be lower-case.
  • The <span> tag for colored reminders should have no spaces, except for one space immediately after the span and one space between any attributes. The color name must be specified in exactly the format shown: a double quote, a hash sign, exactly six hexadecimal digits, and the closing double quote.
  • Tags must nest correctly. If a closing tag doesn't correspond to the most recently-unclosed opening tags, results are undefined. ๐Ÿ’€

If a FMT-style reminder seems to be incorrectly formatted, use the -dm command-line option to debug any problems with the FMT markup language. it's your little detective moment ๐Ÿ”

To get literal <, > or & characters in the output, use the following escape sequences. These are the only ones supported!

  • To include < in the output, use &lt;
  • To include > in the output, use &gt;
  • To include & in the output, use &amp;

โฐ WHEN FORMATTING HAPPENS โฐ

Remind applies formatting in the following situations:

  • In the terminal, in both Agenda Mode and -c Calendar Mode, Remind applies formatting only if the -@ command-line option is also supplied. If the -@ option is missing, Remind simply strips the formatting tags from the output. Also, colors specified in formatting tags are quantized according to the -@ argument, so for best color fidelity, use -@2 assuming your terminal supports true-color mode, or -@1 if it supports 256 colors. ๐Ÿ’…
  • When passing information to back-ends with the -p option, Remind transmits the original markup text and sets the type to SPECIAL FORMATTED. It is then up to the back-end to interpret the markup language. The Remind back-ends tkremind, rem2pdf and rem2html all support formatted reminders. The deprecated rem2ps back-end does not. ๐Ÿ˜ฌ
    • If you have a back-end that does not handle SPECIAL FORMATTED reminders, you can supply the --no-fmt command-line option to Remind. This will cause it to strip out markup from FMT-style reminders and transmit them to the back-end as if they were MSG-style reminders.
NOTE: If you set the $DefaultColor system variable to other than "-1 -1 -1", then FMT-style reminders are treated as if they have an enclosing <span color="ABCDEF">...</span> set of tags, where ABCDEF is set according to $DefaultColor. Also, if the -@ command-line option is used, $DefaultColor is obeyed even if you have used the --no-fmt command-line option.

If you use a %"...%" sequence with a FMT-style reminder, make sure that the portion of the reminder within the delimiters has correct markup (in other words, make sure all tags are nested properly and no tags are left unclosed.) fr fr, this one will bite you ๐Ÿซถ

Here are some examples of formatted reminders:

     REM Tuesday FMT Go <b>boldly</b> into the <span color="#0000ff">blue!</span>

     REM Wednesday FMT Make <i>sure</i> to <b><i>do the job!</i></b>

๐Ÿ’– MISCELLANEOUS ๐Ÿ’–


โœจ COMMAND AND KEYWORD ABBREVIATIONS โœจ

ok bestie these tokens can be shortened, you don't have to type the whole thing, no cap:

  • CLEAR-OMIT-CONTEXT --> CLEAR
  • PUSH-OMIT-CONTEXT --> PUSH
  • POP-OMIT-CONTEXT --> POP
  • DUMPVARS --> DUMP
  • BANNER --> BAN
  • INCLUDE --> INC
  • MAYBE-UNCOMPUTABLE --> MAYBE
  • SCANFROM --> SCAN

๐Ÿฆ‹ NIFTY EXAMPLES ๐Ÿฆ‹

This part is literally just a lil sampling of what Remind can do for you. Snack on these:

REM 5 Feb 1991 AT 14:00 +45 *30 \
RUN mail -s "Meeting at %2" $LOGNAME </dev/null &

On 5 February, 1991, this reminder mails you reminders about a 2:00pm meeting at 1:15, 1:45 and 2:00. The subject of the mail message is "Meeting at 2:00pm" and the body is just... blank. It's giving minimalism ๐Ÿ’…

REM AT 17:00 RUN echo "5:00pm - GO HOME!" | xless -g +0+0 &

This one pops up an xless window at 5:00pm every single day. The window contains the line "5:00pm - GO HOME!" and honestly? it's right.

REM AT 23:59 RUN (sleep 120; remind -a [filename()]) &

This reminder runs at one minute to midnight, and it makes a brand-new Remind process start at one minute past midnight. Why? So you can have a continuous reminder service and work through the night and STILL get timed reminders for early in the morning. Note: this trick is no longer necessary, as long as you run Remind in daemon mode. So it's giving legacy icon ๐Ÿซถ

remind -c12 /dev/null Jan 1993

This invocation makes Remind print a calendar for 1993, with every entry left blank. Empty. Void. Main character with nothing to do.

REM CAL [trigdate()-date(year(trigdate()), 1, 1)+1]

This one puts an entry in each box of a calendar showing the number (1-365 or 366) of the day of the year. Day-count realness โญ

REM Tue 2 Nov SATISFY (year(trigdate())%4) == 0
IF trigvalid()
     REM [trigdate()] ++5 MSG \
     U.S. Presidential Election!!
ENDIF

This warns you 5 days ahead of each American presidential election. The first REM command calculates the first Tuesday after the first Monday in November. (Equivalent to the first Tuesday on or after 2 November.) The SATISFY clause makes sure the trigger date only gets issued in election years, which are multiples of 4. The second REM command actually issues the reminder. Civic duty slay ๐Ÿ—ณ๏ธ


๐ŸŒธ DETAILS ABOUT TRIGGER COMPUTATION ๐ŸŒธ

Here's a conceptual description of how triggers get calculated. Heads up: Remind actually uses a much more efficient procedure, but the results are the same as if it had followed this conceptual version. So think of this as the vibes-based explanation ๐Ÿ’œ

Remind starts from the current date (that is, the value of today()) and scans forward, examining each day one at a time until it finds a date that satisfies the trigger, or can prove that no such dates (on or later than today()) exist.

If Remind is executing a SATISFY-type reminder, it evaluates the expression with trigdate() set to the date found above. If the expression evaluates to zero or the null string, Remind keeps going with the scanning procedure described above, starting with the day after the trigger found above.

The SCANFROM clause (syntax similar to UNTIL) can modify the search strategy used. In that case, Remind begins the scanning procedure at scan_date, which is the date specified in the SCANFROM clause. For example:

REM Mon 1 SCANFROM 17 Jan 1992 MSG Foo

The example above will always have a trigger date of Monday, 3 February 1992. Why? Because Remind starts scanning from 17 January 1992 and stops scanning as soon as it hits a date that satisfies "Mon 1."

The main use of SCANFROM is when you want to calculate the positions of floating holidays. Consider the Labour Day example shown much earlier. Labour Day is the first Monday in September. It can move over a range of 7 days. Look at this sequence:

REM Mon 1 Sept SCANFROM [today()-7] ADDOMIT MSG Labour Day
REM Mon AFTER MSG Hello

The SCANFROM clause makes sure Remind begins scanning from 7 days before the current date. That ensures Labour Day for the current year keeps being triggered until 7 days after it has occurred. Which lets you safely use the AFTER keyword as shown. Chef's kiss ๐Ÿ˜Œ

As a special case, you can just use a negative number after SCANFROM; a negative number -N is interpreted as N days before today. So the previous example could also be written like this:

REM Mon 1 Sept SCANFROM -7 ADDOMIT MSG Labour Day
REM Mon AFTER MSG Hello

A SCANFROM that specifies a full date is called an absolute SCANFROM, and a SCANFROM that specifies a negative number is called a relative SCANFROM. Naming things, we love it ๐Ÿ’…

In general, use SCANFROM as shown for safe movable OMITs. How far back you should scan (the 7 days in the example above) depends on the number of possible consecutive OMITted days that may occur, and on the range of the movable holiday. Generally, a value of 7 is safe. Bestie math ๐Ÿงฎ

The FROM clause operates almost like the counterpoint to UNTIL. It prevents the reminder from triggering before the FROM date. For example, this reminder:

REM Mon Thu FROM 23 Jul 2007 UNTIL 2 Aug 2007 MSG Test

will trigger on Mondays and Thursdays between 23 July 2007 and 2 August 2007 inclusive.

FROM is really just syntactic sugar; you could implement that reminder like this instead:

REM Mon Thu SCANFROM [max(today(), '2007-07-23')] \
       UNTIL 2 Aug 2007 MSG Test

but that's a lot harder to read. Internally, Remind treats FROM exactly as illustrated using SCANFROM. And for that reason, you cannot use both FROM and SCANFROM. Pick a lane, bestie ๐Ÿ˜ญ

Heads up: if you use one REM command to calculate a trigger date, do date calculations (addition or subtraction, for example) and then use the modified date in a subsequent REM command, the results may not be what you intended. That's because you've circumvented the normal scanning mechanism. Try to write REM commands that compute trigger dates that can be used unmodified in subsequent REM commands. The file "defs.rem" that comes with the Remind distribution contains examples. ๐Ÿ’–

๐Ÿ’ซ DETAILS ABOUT TRIGVALID() ๐Ÿ’ซ

The trigvalid() function returns 1 if Remind could find a trigger date for the previous REM or IFTRIG command. More specifically, it returns 1 if Remind finds a date not before the starting date of the scanning that satisfies the trigger. And there's one special case where trigvalid() returns 1 and trigdate() returns a meaningful result:

If the REM or IFTRIG command did not contain an UNTIL or SATISFY clause, and contained all of the day, month and year components, then Remind will correctly compute a trigger date, even if it happens to be before the start of scanning.

Note: this behaviour is not true for versions of Remind prior to 03.00.01. So if you're on an ancient version... thoughts and prayers ๐Ÿ™

๐ŸŽ€ FILES ๐ŸŽ€

The traditional location of your reminders file or directory is:

$HOME/.reminders

where $HOME is your home directory. Classic. Home sweet home ๐Ÿ 

Remind ships with some preinstalled files for holidays and language packs. These live in:

/usr/share/remind/
Do NOT hard-code the above directory in your reminder files. Instead, use the value of the $SysInclude system variable. We're being portable, periodt โœจ

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Dianne Skoll <dianne@skoll.ca> wrote Remind. The moon phase code was copied largely unmodified from "moontool" by John Walker. The moonrise/moonset code comes from https://github.com/signetica/MoonRise by Stephen R. Schmitt and Cyrus Rahman. The sunrise and sunset functions use ideas from programs by Michael Schwartz and Marc T. Kaufman. The Hebrew calendar support was taken from "hdate" by Amos Shapir.

The supported languages and their translators are listed below. Languages marked "complete" support error messages in that language; all others only support the substitution filter mechanism and month/day names. (iykyk)

  • German -- Wolfgang Thronicke
  • Dutch -- Willem Kasdorp and Erik-Jan Vens
  • Finnish -- Mikko Silvonen (complete)
  • French -- Laurent Duperval (complete)
  • Norwegian -- Trygve Randen
  • Danish -- Mogens Lynnerup
  • Polish -- Jerzy Sobczyk (complete)
  • Brazilian Portuguese -- Marco Paganini (complete)
  • Italian -- Valerio Aimale
  • Romanian -- Liviu Daia
  • Spanish -- Rafa Couto
  • Icelandic -- Bjรถrn Davรญรฐsson

International slay ๐ŸŒ๐Ÿ’–


๐Ÿ’€ BUGS ๐Ÿ’€

If you find a bug in Remind, please report it to: dianne@skoll.ca ๐Ÿ“ง

There's no good reason why read-only system variables are not implemented as functions, or why functions like version(), etc. are not implemented as read-only system variables. (We said what we said.)

Hebrew dates in Remind change at midnight instead of sunset. Not me pointing that out ๐Ÿ˜ญ

Remind has some built-in limits (for example, number of global OMITs.)


๐Ÿ“š BIBLIOGRAPHY ๐Ÿ“š

  • Nachum Dershowitz and Edward M. Reingold, "Calendrical Calculations", Software-Practice and Experience, Vol. 20(9), Sept. 1990, pp 899-928.
  • L. E. Doggett, Almanac for computers for the year 1978, Nautical Almanac Office, USNO.
  • Richard Siegel and Michael and Sharon Strassfeld, The First Jewish Catalog, Jewish Publication Society of America.
  • Jean Meeus, Astronomical Algorithms, Second Edition, Willmann-Bell, Inc.

Reading list core ๐Ÿ“–โœจ


๐ŸŒˆ HOME PAGE ๐ŸŒˆ

https://dianne.skoll.ca/projects/remind/


๐Ÿ’Œ MAILING LIST ๐Ÿ’Œ

https://dianne.skoll.ca/mailman/listinfo/remind-fans

Come hang out, bestie ๐Ÿซถ


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

rem2ps(1), rem2pdf(1), tkremind(1), rem2html(1)


ok that's the whole page, we did it ๐ŸŽ‰ this was the Remind manual page, version 2026-09-10, and the source is Remind โ€” like, the program itself, the whole icon. Thanks for reading all 29 parts with me, bestie, you ate that ๐Ÿ’…โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from
  • fedora 43: remind 06.03.03-1.fc43 ยท GPL-2.0-only AND BSD-2-Clause AND (GPL-2.0-only AND LicenseRef-Fedora-Public-Domain) AND LicenseRef-Fedora-Public-Domain
  • fedora 44: remind 06.03.03-1.fc44 ยท GPL-2.0-only AND BSD-2-Clause AND (GPL-2.0-only AND LicenseRef-Fedora-Public-Domain) AND LicenseRef-Fedora-Public-Domain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms