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:
- If the
--file=filenameoption is given, thenfilenameis used. - If the environment variable
REMIND_FILEis set, then its value is used. - If the environment variable
DOTREMINDERSis set, then its value is used. (this env var gets checked for historical reasons and to maintain backward-compatibility, iykyk) - Otherwise, a default value of
$HOME/.remindersis 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-noption 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 throughsort(1). Note that the-noption causes any-goption to be ignored and also implicitly enables the-ooption.-j[n]โ Runs Remind in"purge"mode to get rid of expired reminders. See the sectionPURGE MODEfor details.-rโ The-roption disablesRUNdirectives and theshell()function.-c[flags]nโ The-coption 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-ooption.
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$TerminalHyperlinksto1. 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 than64is considered "on", and if any of the three color components is greater than128, 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-woption 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 as0, it defaults to the larger of71or the actual width of your terminal, or to80if standard output is not a terminal. If col is specified as the lettert, then Remind attempts to get the width of the/dev/ttyterminal device. This is useful, for example, if you pipe calendar output intoless; 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-soption is very similar to the-coption, 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-ooption.
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 theRem2PSprogram that makes a PostScript calendar, plus various other back-end programs. Ifnstarts 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, onlyrem2pdfandrem2htmldo. 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 passINFOstrings to a back-end, you must use-ppor-ppp. The simpler-pformat is not capable of transmitting theINFOstrings 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-poption and Remind outputs additional information for back-end programs such asrem2ps. 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-cor-poptions 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$RunOffsystem variable. She's chatty, she's nosy, she's keeping receipts. ๐-oโ causes Remind to ignore allONCEdirectives. And bestie,ONCEis also ignored if any of the-c,-n,-p, or-soptions is used, if a repetition factor*nis used, or if a date other than today's date is specified on the command-line. So many ways to makeONCEsimply not show up. ๐ญ-tโ causes Remind to trigger all non-expired reminders, regardless of thedeltasupplied for each reminder. No chill, no delay, no filter. ๐ฅ-tnโ if you supply a numbernafter the-toption, then Remind pretends that everyREMcommand has adeltaof++n, regardless of any existing delta. Gaslighting the parser, respectfully. ๐-tzโ if you supply the letterzafter the-toption, then Remind sets allREMstatements' deltas to zero, regardless of the value supplied in theREMstatement itself. In effect, this disables all deltas of the form+nand++n. Delulu? No. Zero-lu. โจ-tt[n]โ causes Remind to assume a default delta ofnminutes for all timed reminders. If-ttis given with non, a default delta of5minutes is used. ๐-hโ the-hoption ("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-aoptions, 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-aoptions you supply, Remind will not include timed reminders in the calendar if at least one-aoption is used.) Twoa'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-doption enables certain debugging modes, andcharsspecifies which modes to enable. Buckle up, here's the whole menu:eโ Echo all input linesxโ Trace all expression evaluationtโ Display all trigger date computationvโ Dump the variable table after execution of the reminder scriptlโ Echo lines when displaying error messagesfโ Trace the reading of reminder filespโ Issue warnings if aPOP-OMIT-CONTEXT,POP-VARSorPOP-FUNCSmatches a correspondingPUSHthat 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 wereSET, 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 aTRANSLATEcommand each time the_()built-in function is called or the%(...)substitution sequence is encountered.mโ Debug any problems withFMT-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-goption causes Remind to sort reminders by date and time prior to issuing them. The optionalaanddcharacters 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-gis ignored if you use the-noption. ๐
-b[n]โ Set the time format for the calendar and simple-calendar outputs.Ncan range from0to2, with the default0. A value of0causes times to be inserted in 12-hour (am/pm) format.1causes times to be inserted in 24-hour format, and2inhibits the automatic insertion of times in the calendar output. Pick your clock aesthetic. โฐ-x[n]โ Sets the iteration limit for theSATISFYclause of aREMcommand. Defaults to10000. Bestie, we are not looping forever, we have boundaries. ๐-kcmdโ instead of simply printingMSG-type reminders, this causes them to be passed to the specificcmd. 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-roption and theRUN OFFcommand.
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 ofxmessageprocesses with the above technique. So be very careful. Because all shell and whitespace characters are escaped, the program you execute with the-koption 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". Ifnis supplied, it specifies how often (in minutes) Remind should wake up to check if the reminder script has been changed.Ndefaults to1, and can range from1to60. Note that the use of the-zoption also enables the-foption. 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 variablesHOME,SHELLandUSERto that user's home directory, shell, and user name respectively.LOGNAMEalso 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-uimplies-r, so theRUNdirective andshell()functions are disabled ๐ซ. However! If you prefix name with a+sign, thenRUNandshell()stay enabled. So like:-uwhateverswitches to userwhateverand disablesRUN, whereas-u+whateverswitches towhateverbut leavesRUNalive 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 disablesRUNand theshell()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 aTAGclause ๐ท๏ธ.-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=exprpart, then var gets initialized to0. In other words,-ivaris 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--fileoption, 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.--jsonalso disables sorting (the-goption) and disables queueing (the-qoption). See the section "AGENDA MODE JSON OUTPUT" for more deets. The--jsonoption is ignored in Calendar Mode. Note that in JSON mode, the output from anyRUN-type reminder that would normally appear on standard output is redirected to standard error instead; this is so thatRUN-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 aTRANSLATEcommand. If youTRANSLATEthe error messages, then Remind will use the translated versions when outputting error and warning messages. See alsoTRANSLATE GENERATEin 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./configurecommand 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 to10000000(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--testlong option is only for use by the acceptance tests run bymake 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, theREMtoken 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 theREMcommand, 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 from1990to2075. - 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:
- 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
- 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.
- Only month present. Triggers every day of the specified month. Like:
REM Feb MSG Every day in February
- day and month present. Like:
REM 6 Jan MSG Every 6th of January
REM Feb 29 MSG Every 29th of February
- Only year present. Like:
REM 1991 MSG Every day in 1991
- 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
- year and month present. Like:
REM Feb 1991 MSG Every day in Feb 1991
REM 1992 September MSG Every day in Sept 1992
- year, month and day present. Like:
REM 8 Jan 1991 MSG 8th January 1991.
REM 1992 March 9 MSG 9th March 1992.
- 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
- 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
- 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
- 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
- weekday and year present. Like:
REM Sat Sun 1991 MSG Every Saturday and Sunday in 1991
- 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
- weekday, month and year present. Like:
REM Mon Wed 1991 Feb MSG Every Mon and Wed in Feb 1991.
- 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 _thirdportion 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_thirdalso returns non-zero if the weekday is Sunday or Saturday. - the
AFTERkeyword 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"wherediffis 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 (1to12) 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 aREMcommand, but is useful in aBANNERcommand. (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 (01to31) 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 (01to12) padded to two digits with a leading zero.%uโ gets replaced with"on weekday, day-th month, year". This is similar to%aexcept 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 ofany_textin the translation table. It is the equivalent of[_("any_text")]but is more convenient to type. ๐ธ%<any_text>โ gets replaced with theINFOvalue associated with the headerany_textor the empty string if no suchINFOvalue 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 -cpreserves newlines in the terminal calendar output. rem2pdfpreserves newlines ifremindis invoked with the-ppor-pppoption.rem2htmlpreserves newlines ifremindis invoked with the-ppoption.tkremindpreserves newlines.rem2psconverts newlines to spaces. Butrem2psis deprecated; userem2pdfinstead. ๐จ- The
"simple calendar"formats (i.e.,remind's-s,-nand-poptions) convert newlines to spaces.
- Running
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-aoption, 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 theATtime of the reminder.%3โ gets replaced with"at hh:mm"in 24-hour format.%4โ gets replaced with"mm"wheremmis the number of minutes between"current"and the trigger date and time specified byAT. If theATtime is earlier than the current time, then the result is negative.%5โ gets replaced with"ma"wheremais the absolute value of the number produced by%4.%6โ gets replaced with"ago"or"from now", depending on the relationship between theATtime and the current time.%7โ gets replaced with the number of hours between theATtime and the current time. It is always non-negative and always between0and23. (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 theATtime and the current time, after the hours (%7) have been subtracted out. This is a number ranging from0to59.%9โ gets replaced with"s"if the value produced by%8is not1.%0โ gets replaced with"s"if the value produced by%7is not1.%!โ gets replaced with"is"if the current date and time is before the trigger date and theATtime, 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 theATtime, 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%2but displays the current time.%#โ is similar to%3but displays the current time.%:โ gets replaced with" (done)"for aTODOreminder whose trigger date is on or after itsCOMPLETE-THROUGHdate. It is replaced with the empty string in any other situation. Note that because Remind does not display completedTODOreminders 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,-sor-poption 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$AddBlankLinesto0. - Substitutions
a,b,c,e,f,g,h,i,j,k,l,uandvall 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, and3substitutions 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 andrealtoday()instead oftoday(). - Any of the substitutions dealing with time (
0through9) produce undefined results if used in a reminder that does not have anATkeyword. ๐จ Also, if a reminder has a delta and may be triggered on several days, the time substitutions ignore the date. Thus, the%1substitution 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 aMSG,CALorRUNtoken. ๐ธ
๐ 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
TODOdesignator from theREMcommand (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-THROUGHclause 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 specifyCOMPLETE-THROUGHwithout also specifyingTODO. and heads up โ the keywordCOMPLETED-THROUGHmay be used as a synonym forCOMPLETE-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
OMITcommand 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 ofBEFOREwould 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 afterTZ, the results are undefined. And like we said โ time zone names are case-sensitive, soAmerica/Torontois valid butamerica/torontois 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
RUNand theshell()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 disableRUNandshell()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 ifRUNis disabled, thenINCLUDECMDwill 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 recentPUSH-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โ theINTdata type is the integers representable in one machine word. It corresponds to the Cinttype.STRINGโ theSTRINGdata 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โ theTIMEdata 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 aTIMEis used decides which one it means.DATEโ theDATEdata type is dates (later than 1 January 1990). Internally,DATEobjects are stored as the number of days since 1 January 1990.DATETIMEโ theDATETIMEdata type is a date and time together. Internally,DATETIMEobjects are stored as the number of minutes since midnight, 1 January 1990. You can think of aDATETIMEobject as being the combination ofDATEandTIMEparts. 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โ0DATEโ'1990-01-01'TIMEโ00:00DATETIMEโ'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, returns0. Otherwise, returns1.-โ Unary minus. Can be applied to anINT. Returns the negative of the operand.*โ Multiplication. Returns the product of twoINTs. Alternatively, if one argument is aSTRINGand the other anINT, returns aSTRINGconsisting of theINTnumber of repeats of the originalSTRING. In this case, theINTargument cannot be negative./โ Integer division. Returns the quotient of twoINTs, discarding the remainder.%โ Modulus. Returns the remainder upon dividing oneINTby another.+โ Has several uses. These are:INT + INTโ returns the sum of twoINTs.INT + TIMEorTIME + INTโ returns aTIMEobtained by addingINTminutes to the originalTIME. The result will always range from00:00through23:59.TIME + TIMEโ treats the secondTIMEparameter as a duration, converting it to an integer number of minutes past midnight, and then performs addition as withTIME + INT.INT + DATEorDATE + INTโ returns aDATEobtained by addingINTdays to the originalDATE.INT + DATETIMEorDATETIME + INTโ returns aDATETIMEobtained by addingINTminutes to the originalDATETIME.DATETIME + TIMEorTIME + DATETIMEโ treats theTIMEparameter as a duration, converting it to an integer number of minutes past midnight, and then performs addition as withDATETIME + INT.STRING + STRINGโ returns aSTRINGthat is the concatenation of the two originalSTRINGs.STRING + anythingoranything + STRINGโ converts the non-STRINGargument to aSTRING, and then performs concatenation. See thecoerce()function.
-โ Has several uses. These are:INT - INTโ returns the difference of twoINTs.DATE - DATEโ returns (as anINT) the difference in days between twoDATEs.TIME - TIMEโ returns (as anINT) the difference in minutes between twoTIMEs.DATETIME - DATETIMEโ returns (as anINT) the difference in minutes between twoDATETIMEs.DATE - INTโ returns aDATEthat isINTdays earlier than the originalDATE.TIME - INTโ returns aTIMEthat isINTminutes earlier than the originalTIME.DATETIME - INTโ returns aDATETIMEthat isINTminutes earlier than the originalDATETIME.
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,$Latitudeis 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,$Longitudeis 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,$LongMinand$LongSecupdates$Longitudecorrespondingly, and setting$Longitudeupdates$LongDeg,$LongMinand$LongSec. Similar rules apply to$Latitude,$LatDeg,$LatMinand$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$MaxLateMinutesthat is in effect when it has finished reading the reminder file and puts itself in the background. Generally, you should set$MaxLateMinutesonce 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$MaxStringLento0or-1because 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$NumTrigis affected only byREMcommands; triggers inIFTRIGcommands 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 aONCE-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 parseREMstatements that aren't triggered.0(the default) means skip parsing them,1means 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-loption was supplied on the command line.$PSCal(read-only) โ if it's non-zero, then the-poption was supplied on the command line.$Repeat(read-only) โ if this variable holds a non-zero value n, then a command-line argument of*nwas supplied to specify repeated runs of Remind.$RunOff(read-only) โ if non-zero, theRUNdirectives are disabled.$Shaded(read-only) โ returns the number of times aSHADEspecial 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-por the-scommand-line option was supplied.$SortByDate(read-only) โ set to0if no-goption is used,1if sorting by date in ascending order, or2if sorting by date in descending order.$SortByPrio(read-only) โ set to0if no-goption is used,1if sorting by priority in ascending order, or2if sorting by priority in descending order.$SortByTime(read-only) โ set to0if no-goption is used,1if sorting by time in ascending order, or2if sorting by time in descending order.$SubsIndentโ the number of spaces that all lines (except the first) of anMSF-type reminder should be indented by. Default is0.$SuppressImplicitWarningsโ normally Remind warns you if a line starts with an unknown token and gets treated as aREMcommand, or if aREMcommand is missing a type and gets treated as aMSG-type reminder. Setting$SuppressImplicitWarningsto1shuts those warnings up. Default is0, and we do not recommend disabling the warnings.$SuppressLRMโ normally, when Remind runs with the-coption 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$SysIncludeis/usr/share/remind.$T(read-only, DATE or INT type) โ equivalent totrigdate(). (See BUILT-IN FUNCTIONS.)$Tb(read-only, DATE or INT type) โ equivalent totrigbase().$Td(read-only) โ equivalent today(trigdate()).$Tm(read-only) โ equivalent tomonnum(trigdate()).$Tu(read-only, DATE or INT type) โ equivalent totriguntil().$Tw(read-only) โ equivalent towkdaynum(trigdate()).$Ty(read-only) โ equivalent toyear(trigdate()).$Tt(read-only, TIME or INT type) โ equivalent totrigtime().$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 aTIMEorDATETIMEvalue.$TimetIs64bit(read-only) โ returns1if the internal Ctime_ttype is at least 64 bits long. If it returns0, 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) โ if0, then both events and TODOs are being output. If1, then the--only-todoscommand-line option was supplied. If2, then the--only-eventscommand-line option was supplied.$UntimedFirst(read-only) โ set to1if the-goption is used with a fourth sort character of"d"; set to0otherwise.$U(read-only, DATE type) โ exactly equivalent totoday(). (See BUILT-IN FUNCTIONS.)$Ud(read-only) โ equivalent today(today()).$Um(read-only) โ equivalent tomonnum(today()).$Uw(read-only) โ equivalent towkdaynum(today()).$Uy(read-only) โ equivalent toyear(today()).$UseVTColors(read-only) โ set to1if the-@or-ccoptions were used;0otherwise.$UseBGVTColors(read-only) โ set to1if the-@,,1option was used;0otherwise.$Use256Colors(read-only) โ set to1if the-@1option was used;0otherwise.$UseTrueColors(read-only) โ set to1if the-@2option was used;0otherwise.$TerminalBackground(read-only) โ returns-1if the terminal background color couldn't be determined,0if it was found to be dark (or was specified as dark with the-@,0option), or1if it was found to be light (or specified as light with the-@,1option). 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 (seehttps://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda), then you can set this variable to1. Remind will then turn any reminder with a"Url:"info string into a hyperlink in your terminal. ๐ By default,$TerminalHyperlinksis set to1if Remind's standard output is a terminal, or0if 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$WarningLevelto a string of the formAB.CD.EF, whereAB,CDandEFare pairs of decimal digits. That suppresses any warnings introduced after Remind versionAB.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$NextModeare 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
0to12or 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 thegetenv(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, sogetenv("HOME")is not the same asgetenv("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"<",">"becomes">", and"&"becomes"&". 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 version03.00.05of Remind, it accepted 3 arguments only. The 3-argument version ofiif()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 โindexuses byte positions, not character positions, so do not use it on non-ASCII strings. Usembindexfor 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])โ likeindex()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]);โ returns1if the first argument arg1 is equal to any of the subsequent arguments arg2 through argN; returns0otherwise. Also returns0if 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 ๐ returning1if the expression is constant or0if it is non-constant. Note thatisconstdoes not take into account the context; if arg is a constant expression but evaluated in a non-constant context,isconstwill still return1. For details about constant vs. non-constant expressions, see the section "NON-CONSTANT EXPRESSIONS".isdst([d_date [,t_time]])orisdst(q_datetime)โ returns a positive number if daylight saving time is in effect on the specified date and time ๐ Date defaults totoday()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)โ returns1if arg is a leap year, and0otherwise. 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)โ returns1if date is omitted, given the current global OMIT context. Returns0otherwise. (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...]])โ thejoinfunction takes any number of arguments of any type ๐ it converts them all to STRING, concatenates them, and returns the resulting string. Callingjoin()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, usemblowerinstead.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]])orminsfromutc(q_datetime)โ returns the number of minutes from Universal Time Coordinated (formerly GMT) to local time on the specified date and time โญ Date defaults totoday()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 from1to12, 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)ormonnum(s_str)โ returns an INT from1to12, 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]])ormoondate(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 from0to3, with0signifying new moon,1first quarter,2full moon, and3third quarter. If date is omitted, it defaults totoday(). 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]])ormoontime(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 from0to3, with0signifying new moon,1first quarter,2full moon, and3third quarter. If date is omitted, it defaults totoday(). If time is omitted, it defaults to midnight.Moontime()is intended to be used in conjunction withmoondate(). Themoondate()andmoontime()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]])ormoondatetime(i_phase, q_datetime)โ this function is similar tomoondateandmoontime, but returns a DATETIME result. Two birds, one icon ๐moonphase([d_date [,t_time]])ormoonphase(q_datetime)โ this function returns the phase of the moon on date and time, which default totoday()and midnight, respectively. The returned value is an integer from0to359, representing the phase of the moon in degrees ๐0is a new moon,180is a full moon,90is 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 totoday(). ๐
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 totoday(). ๐งญ The return value ranges from0to359, where0is North,90is East,180is South and270is 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 โ:
trigreturns the first trigger date that would have triggered todaymultitrigreturns 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: unlikeevaltrig,multitrigalways returns a DATE and never a DATETIME. so if you sneak anATclause into a trigger you feed tomultitrig, 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 thatorthodoxeastercomputes the Orthodox Easter. for the Western Easter date, go check outeasterdate. 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't1, and""if num is1 - two arguments โ returns str1 +
"s"if num isn't1. 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:psmoonandpsshadeare 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: ifRUN OFFhas been executed, or the-rcommand-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:
0is the March equinox ๐ฑ1is the June solstice โ๏ธ2is the September equinox ๐3is 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+3delta outside of thetrigfunction for advance warning to work properly. This is becausetrigreturns a date constant (the trigger date) and theREMcommand does not know the details oftrig'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: Becausetrig()always returns an absolute date, it will not work properly with aSATISFYclause. 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 recentREMorIFTRIGcommand ๐. If you call it inside the body of aREMcommand, it hands you that command's trigger date. And if the lastREMcommand couldn't compute a trigger date at all? You get the integer0. That's it, that's the vibe.trigdatetime()โ liketrigdate()but glowier โจ. It returns aDATETIMEif the most recent triggerableREMcommand had anATclause. NoATclause? Then you get aDATE. Couldn't compute a trigger? You get the integer0. Peep MULTI-DAY EVENTS for the tea.trigeventstart()โ returns aDATETIMEthat represents the start of the most recent triggerableREMcommand that had anATclause ๐ซถ. For events with noDURATION, or ones that don't span multiple days, it returns the same thing astrigdatetime(). But if theREMcommand had noATclause, it returns the integer-1โ and yes, that's exactly where it differs fromtrigdatetime(). Peep MULTI-DAY EVENTS for more.trigeventstarttz()โ same energy astrigeventstart()but it returns theDATETIMEin the time zone given by aTZclause, if there was one ๐. NoTZclause? Then it returns the same value astrigeventstart().trigeventduration()โ returns aTIMErepresenting the duration of the most recent triggerableREMcommand that had both anATand aDURATIONclause โณ. If the event doesn't span multiple days, it returns the same thing astrigduration(). If theREMcommand was missing anATorDURATIONclause, you get-1. Peep MULTI-DAY EVENTS for more.trigback()โ returns the "back" amount of the lastREMorIFTRIGcommand ๐. Positive integerNif the "back" looks like-N, or a negative integer if it looks like--N. No "back" at all? Then0.trigbase()โ returns the "base" date of the lastREMorIFTRIGcommand ๐. 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 get0.
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 lastREMorIFTRIGcommand ๐ฆ. Positive integerNif the "delta" is of the form+N, or a negative integer if it's of the form++N. No "delta"? Then0.trigtimedelta()โ liketrigdelta(), but returns the delta used in theATclause of a timed reminder โฐ.trigrep()โ returns the "repeat" amount of the lastREMorIFTRIGcommand ๐. Positive integerNif the "repeat" is of the form*N. No "repeat"? Then0.trigtimerep()โ liketrigrep(), but returns the repeat used in theATclause of a timed reminder ๐ธ.trigtz()โ if aTZclause was used in the lastREMorIFTRIGcommand, it returns the time zone name ๐บ๏ธ. Otherwise it returns the empty string.trigduration()โ returns (as aTIMEtype) theDURATIONparameter of a timed reminder โ. NoDURATIONparameter? Then you get the integer-1. Peep MULTI-DAY EVENTS for more.trigpriority()โ returns thePRIORITYof the lastREMorIFTRIGcommand โญ.triguntil()โ returns (as aDATEtype) theUNTILparameter of the lastREMorIFTRIGcommand ๐ . NoUNTILparameter? Then you get the integer-1. And heads up: if there's aTHROUGHparameter,triguntil()returns that one, because"THROUGH yyyy-mm-dd"is literally just syntactic sugar for"*1 UNTIL yyyy-mm-dd"๐ฌ.trigscanfrom()โ returns (as aDATEtype) theSCANFROMparameter of the lastREMorIFTRIGcommand ๐. NoSCANFROMparameter? Then you get the integer-1. But bestie,FROMandSCANFROMinteract: a reminder that has a"FROM yyyy-mm-dd"parameter will act as if it has aSCANFROMparameter whose value is the maximum of"yyyy-mm-dd"and today. Noted. ๐trigfrom()โ returns (as aDATEtype) theFROMparameter of the lastREMorIFTRIGcommand ๐. NoFROMparameter? Then you get the integer-1.triginfo(s_header)โ returns aSTRINGthat is theINFOitem 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()โ returns1if the lastREMcommand was aTODOtype, or0if not โ .trigcompletethrough()โ returns aDATEobject that is theCOMPLETE-THROUGHdate of the most recentREMcommand ๐. NoCOMPLETE-THROUGHdate? Then you get theINT0.trigmaxoverdue()โ returns anINTthat is theMAX-OVERDUEvalue of the most recentREMcommand ๐ฌ. NoMAX-OVERDUEclause? Then you get-1.trigger(d_date [,t_time [,i_utcflag]])ortrigger(q_datetime [,i_utcflag])โ returns a string you can drop straight into aREMcommand, or aSCANFROMorUNTILclause, so you can calculate trigger dates way ahead of time ๐ฎ. Fun lore drop: in earlier versions of Remind,triggerwas required to convert a date into something theREMcommand 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 about2 January 1990in your local time zone. The author says they do not anticipate this restriction being a real problem ๐.
trigtags()โ returns a comma-separated list of theTAGs associated with the most recentREMcommand that was triggered ๐ท๏ธโจ. Returns the empty string if there were noTAGs. 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 lastREMcommand with anATclause, in the system default time zone โฐ. If the lastREMhad noATclause, it returns the integer0. Oh, and if aREMcommand has anATclause with aDURATION, you can compute the end time astrigtime() + trigduration(). Math ate. ๐งฎtrigtimetz()โ liketrigtime()but returns the time in the time zone specified by aTZclause, if one was present ๐. NoTZclause? Then it returns the same value astrigtime().trigvalid()โ returns1if the value returned bytrigdate()is valid for the most recentREMcommand, or0otherwise ๐ฏ. SometimesREMcommands just cannot calculate a trigger date. Like, for example, thisREMcommand 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 aDATETIME. 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 aSTRINGwith 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, usembupperinstead. Respect the range. ๐mbupper(s_string)โ returns aSTRINGwith all lower-case characters in string converted to upper-case ๐ก. This one works correctly on any Unicode string. Versatile icon. โจutctolocal(q_datetime)โ given aDATETIMEobject interpreted in UTC, returns aDATETIMEobject 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 variableXY, if it is defined. IfXYis 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 version06.03.03, it returns"06.03.03". And it's guaranteed that as new versions of Remind get released, the value returned byversion()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$FoldYearsystem variable is no longer that useful โ Remind always folds years if it's necessary on a 32-bit system. You can set$FoldYearto1to 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, andtrigduration()will return the originalDURATION. - On each subsequent day of a multi-day event,
trigdatetime()will return midnight on the day in question, andtrigduration()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
SETcommand, or theIFcommand โ 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 aREMcommand. You can paste expressions before and after theMSG, 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
exprthat 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
RUNis disabled, then whenever that function is called,RUNwill be disabled during its evaluation, even if it is called from a context whereRUNis 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
nis positive, then the reminder is triggered exactlyndays before its trigger date. - if
nis negative, then it's triggeredndays before its trigger date, not countingOMITted 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 ๐
- if an error happens while evaluating
warn_function, then Remind stops calling it and just issues the reminder on its trigger date. - if the absolute-values of the return values of
warn_functionare not monotonically decreasing, Remind stops calling it and issues the reminder on its trigger date. warn_functionshould (as a matter of good style) return0as the final value in its sequence of return values. but a reminder will always be triggered on its trigger date regardless of whatwarn_functiondoes.
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 ๐
- if an error happens while evaluating
sched_func, then Remind reverts to using theATtime and the delta and repeat values, and never callssched_funcagain. - if processing
sched_funcyields 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 callssched_funcagain. - it is quite possible using
sched_functo keep triggering a reminder even after theAT-time. also, it is quite possible to not trigger a reminder on theATtime when you use a scheduling function. however, if your scheduling function is terminated (for reasons 1 and 2) before theATtime of the reminder, it will be triggered at theATtime, because normal processing takes over. - your scheduling functions should (as a matter of good style) return
0when no more scheduling is required. see the example. - 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, theOMITcommand will now be omitting Labour Day for 1993, and the"Mon AFTER"command will not be triggered. (But see the description ofSCANFROMin 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 therem2ps(1)man page section "CALENDAR ENTRIES". However, thecalendar_body,plain_bodyandraw_bodykeys 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-ioption and the equal sign; otherwise, strange variable names are created that can only be accessed with thevalue()ordefined()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.BoxWidthandBoxHeightโ 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,/TitleFontand/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,TitleSizeandHeadSizeโ 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$Amand$Pmshould 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 from0to23. 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 from1to31. 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 ond. iconic behavior fr fr.subst_N(alt, date, time)โ this is actually a whole family of functions, whereNis 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%*Ngot encountered;date, the trigger date of the reminder; andtime, the trigger time.subst_Nx(alt, date, time)โ again, a family of functions. same vibe as thesubst_Ncrew except it's only called ifdateis two or more days away fromtoday(). 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
%:withsubst_colon - override
%!withsubst_bang - override
%?withsubst_question - override
%@withsubst_at - override
%#withsubst_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 youSETvarious 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$Hpluand$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:
- Look for an exact match. If found, return.
- 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.
- 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.
- 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')returns21.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')returns5753.hebdate(i_day, s_hebmon [,id_yrstart [,i_jahr [,i_aflag]]])โ Thehebdate()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 digitsABCDEF. Instead ofcolor, you can also usefgcolororforeground. And instead ofbgcolor, you can specifybackground. 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 thespanand 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< - To include
>in the output, use> - To include
&in the output, use&
โฐ WHEN FORMATTING HAPPENS โฐ
Remind applies formatting in the following situations:
- In the terminal, in both Agenda Mode and
-cCalendar 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-@2assuming your terminal supports true-color mode, or-@1if it supports 256 colors. ๐ - When passing information to back-ends with the
-poption, Remind transmits the original markup text and sets the type toSPECIAL FORMATTED. It is then up to the back-end to interpret the markup language. The Remind back-endstkremind,rem2pdfandrem2htmlall support formatted reminders. The deprecatedrem2psback-end does not. ๐ฌ- If you have a back-end that does not handle
SPECIAL FORMATTEDreminders, you can supply the--no-fmtcommand-line option to Remind. This will cause it to strip out markup fromFMT-style reminders and transmit them to the back-end as if they wereMSG-style reminders.
- If you have a back-end that does not handle
NOTE: If you set the$DefaultColorsystem variable to other than"-1 -1 -1", thenFMT-style reminders are treated as if they have an enclosing<span color="ABCDEF">...</span>set of tags, whereABCDEFis set according to$DefaultColor. Also, if the-@command-line option is used,$DefaultColoris obeyed even if you have used the--no-fmtcommand-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-->CLEARPUSH-OMIT-CONTEXT-->PUSHPOP-OMIT-CONTEXT-->POPDUMPVARS-->DUMPBANNER-->BANINCLUDE-->INCMAYBE-UNCOMPUTABLE-->MAYBESCANFROM-->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 oneREMcommand to calculate a trigger date, do date calculations (addition or subtraction, for example) and then use the modified date in a subsequentREMcommand, the results may not be what you intended. That's because you've circumvented the normal scanning mechanism. Try to writeREMcommands that compute trigger dates that can be used unmodified in subsequentREMcommands. 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