neulab/tldr huggingface dataset:
read      [Only new quoting rules] Read a line from standard input, or the channel set active via readctl, and assign the data, which will be split as indicated by ifs, to the given variables.  The variable names are checked by the same rules as documented for vput, and the same error codes will be seen in !; the exit status ? indicates the number of bytes read, it will be ‘-1’ with the error number ! set to ^ERR-BADF in case of I/O errors, or ^ERR-NONE upon End-Of-File.  If there are more fields than variables, assigns successive fields to the last given variable. If there are less fields than variables, assigns the empty string to the remains.
? read a b c H  e  l  l  o ? echo "<$a> <$b> <$c>" <H> <e> <l  l  o> ? wysh set ifs=:; read a b c;unset ifs hey2.0,:"'you    ",:world!:mars.: ? echo $?/$^ERRNAME / <$a><$b><$c> 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
readsh    [Only new quoting rules] Like read, but splits on shell token boundaries (see Shell-style argument quoting) rather than at ifs. [v15 behaviour may differ] Could become a commandalias, maybe ‘read --tokenize --’.
readall   [Only new quoting rules] Read anything from standard input, or the channel set active via readctl, and assign the data to the given variable.  The variable name is checked by the same rules as documented for vput, and the same error codes will be seen in !; the exit status ? indicates the number of bytes read, it will be ‘-1’ with the error number ! set to ^ERR-BADF in case of I/O errors, or ^ERR-NONE upon End-Of-File.  [v15 behaviour may differ] The input data length is restricted to 31-bits.
readctl   [Only new quoting rules] Manages input channels for read, readsh and readall, to be used to avoid complicated or impracticable code, like calling read from within a macro in non-interactive mode.  Without arguments, or when the first argument is show, a listing of all known channels is printed.  Channels can otherwise be created, and existing channels can be set active and removed by giving the string used for creation.
The channel name is expected to be a file descriptor number, or, if parsing the numeric fails, an input file name that undergoes Filename transformations.  For example (this example requires a modern shell):
$ printf 'echon "hey, "\nread a\nyou\necho $a' |\ mail -R# hey, you $ LC_ALL=C printf 'echon "hey, "\nread a\necho $a' |\ LC_ALL=C 6<<< 'you' mail -R#X'readctl create 6' hey, you
remove    [Only new quoting rules] Removes the named files or directories. If a name refers to a mailbox, say a Maildir mailbox, then a mailbox type specific removal will be performed, deleting the complete mailbox.  In interactive mode the user is asked for confirmation.
rename    [Only new quoting rules] Takes the name of an existing folder and the name for the new folder and renames the first to the second one.  Filename transformations including shell pathname wildcard pattern expansions (glob(7)) are performed on both arguments. Both folders must be of the same type.
Reply, Respond (Compose mode)(R) Identical to reply except that it replies to only the sender of each message of the given list, by using the first message as the template to quote, for the ‘Subject:’ etc.; setting flipr will exchange this command with reply.
reply, respond (Compose mode)(r) Take a message (list) and group-respond (to each in turn) by addressing the sender and all recipients, subject to fullnames and alternates processing.  followup-to, followup-to-honour, reply-to-honour as well as recipients-in-cc influence response behaviour.  quote as well as quote-as-attachment configure whether responded-to message shall be quoted etc., content-description-quote-attachment may be used. Setting flipr will exchange this command with Reply.  The command Lreply offers special support for replying to mailing lists.  For more documentation please refer to On sending mail, and non- interactive mode.
Resend    Like resend, but does not add any header lines.  This is not a way to hide the sender's identity, but useful for sending a message again to the same recipients.
resend    Takes a list of messages and a name, and sends each message to the given addressee, which is subject to fullnames. ‘Resent-From:’ and related header fields are prepended to the new copy of the message.  Saving in record is only performed if record-resent is set.  [v15 behaviour may differ](Compose mode) is not entered, the only supported hooks are on-resend-enter and on-resend-cleanup.
retain    (ret) Superseded by the multiplexer headerpick.
return    Only available inside of a defined macro or an account, this command returns control of execution to the outer scope.  The two optional parameters are positive decimal numbers and default to 0: the first specifies the 32-bit return value (stored in ? [v15 behaviour may differ] and later extended to 64-bit), the second the 32-bit error number (stored in !).  As documented for ? a non-0 exit status may cause the program to exit.
Save      (S) Similar to save, but saves the messages in a file named after the local part of the sender of the first message instead of taking a filename argument; outfolder is inspected to decide on the actual storage location.
save      (s) Takes a message list and a filename and appends each message in turn to the end of the file.  Filename transformations including shell pathname wildcard pattern expansions (glob(7)) is performed on the filename.  If no filename is given, the secondary mailbox MBOX is used.  The filename in quotes, followed by the generated character count is echoed on the user's terminal.  If editing a primary system mailbox the messages are marked for deletion.  To filter the saved header fields to the desired subset use the ‘save’ slot of the white- and blacklisting command headerpick.  Also see Copy.
savediscard [Obsolete] Superseded by the multiplexer headerpick.
saveignore [Obsolete] Superseded by the multiplexer headerpick.
saveretain [Obsolete] Superseded by the multiplexer headerpick.
search    Takes a message specification (list) and displays a header summary of all matching messages, as via headers.  This command is an alias of from.  Also see Specifying messages.
seen      Takes a message list and marks all messages as having been read.
set, unset (se, [Only new quoting rules] uns) The latter command will delete all given global variables, or only block-scope local ones if the local command modifier has been used.  The former, when used without arguments, will show all currently known variables, being more verbose if either of debug or verbose is set.  Remarks: this list mode will not automatically link-in (known) ENVIRONMENT variables, this only happens for explicit addressing, examples are varshow, using a variable in an if condition or a string passed to echo, explicit setting, as well as some program- internal use cases (look-ups).
Otherwise the given variables (and arguments) are set or adjusted.  Arguments are of the form ‘name=value’ (no space before or after ‘=’), or plain ‘name’ if there is no value, i.e., a boolean variable.  If a name begins with ‘no’, as in ‘set nosave’, the effect is the same as invoking the unset command with the remaining part of the variable (‘unset save’).  [v15 behaviour may differ] In conjunction with the wysh (or local) command prefix(es) Shell-style argument quoting can be used to quote arguments as necessary.  [v15 behaviour may differ] Otherwise quotation marks may be placed around any part of the assignment statement to quote blanks or tabs.
When operating in global scope any ‘name’ that is known to map to an environment variable will automatically cause updates in the program environment (unsetting a variable in the environment requires corresponding system support) — use the command environ for further environmental control.  If the command modifier local has been used to enforce local scoping then the given user variables will be garbage collected when the local scope is left; for INTERNAL VARIABLES, however, local behaves the same as if localopts would have been set (temporarily), which means that changes are inherited by deeper scopes.  Also see varshow and the sections INTERNAL VARIABLES and ENVIRONMENT.
? wysh set indentprefix=' -> ' ? wysh set atab=$'' aspace=' ' zero=0
shcodec   Apply shell quoting rules to the given raw-data arguments. Supports vput (see Command modifiers).  The first argument specifies the operation: [+]e[ncode] or d[ecode] cause shell quoting to be applied to the remains of the line, and expanded away thereof, respectively.  If the former is prefixed with a plus-sign, the quoted result will not be roundtrip enabled, and thus can be decoded only in the very same environment that was used to perform the encode; also see mle-quote-rndtrip.  If the coding operation fails the error number ! is set to ^ERR-CANCELED, and the unmodified input is used as the result; the error number may change again due to output or result storage errors.
shell     [Only new quoting rules] (sh) Invokes an interactive version of the shell, and returns its exit status.
shortcut, unshortcut [Only new quoting rules] Manage the file- or pathname shortcuts as documented for folder.  The latter command deletes all shortcuts given as arguments, or all at once when given the asterisk ‘*’.  The former shows the list of all currently defined shortcuts if used without arguments, the target of the given with a single argument.  Otherwise arguments are treated as pairs of shortcuts and their desired expansion, creating new or updating already existing ones.
shift     [Only new quoting rules] Shift the positional parameter stack (starting at 1) by the given number (which must be a positive decimal), or 1 if no argument has been given.  It is an error if the value exceeds the number of positional parameters.  If the given number is 0, no action is performed, successfully.  The stack as such can be managed via vpospar.  Note this command will fail in account and hook macros unless the positional parameter stack has been explicitly created in the current context via vpospar.
show      Like type, but performs neither MIME decoding nor decryption, so that the raw message text is shown.
size      (si) Shows the size in characters of each message of the given message list.
sleep     [Only new quoting rules] Sleep for the specified number of seconds (and optionally milliseconds), by default interruptible. If a third argument is given the sleep will be uninterruptible, otherwise the error number ! will be set to ^ERR-INTR if the sleep has been interrupted.  The command will fail and the error number will be ^ERR-OVERFLOW if the given duration(s) overflow the time datatype, and ^ERR-INVAL if the given durations are no valid integers.
sort, unsort The latter command disables sorted or threaded mode, returns to normal message order and, if the header variable is set, displays a header summary.  The former command shows the current sorting criterion when used without an argument, but creates a sorted representation of the current folder otherwise, and changes the next command and the addressing modes such that they refer to messages in the sorted order.  Message numbers are the same as in regular mode.  If the header variable is set, a header summary in the new order is also displayed.  Automatic folder sorting can be enabled by setting the autosort variable, as in ‘set autosort=thread’.  Possible sorting criterions are:
date     Sort the messages by their ‘Date:’ field, that is by the time they were sent. from     Sort messages by the value of their ‘From:’ field, that is by the address of the sender.  If the showname variable is set, the sender's real name (if any) is used. size     Sort the messages by their size. spam     [Option] Sort the message by their spam score, as has been classified by spamrate. status   Sort the messages by their message status. subject  Sort the messages by their subject. thread   Create a threaded display. to       Sort messages by the value of their ‘To:’ field, that is by the address of the recipient.  If the showname variable is set, the recipient's real name (if any) is used.
source    [Only new quoting rules] (so) The source command reads commands from the given file.  Filename transformations will be applied. If the given expanded argument ends with a vertical bar ‘|’ then the argument will instead be interpreted as a shell command and Mail will read the output generated by it.  Dependent on the settings of posix and errexit, and also dependent on whether the command modifier ignerr had been used, encountering errors will stop sourcing of the given input.  [v15 behaviour may differ] Note that source cannot be used from within macros that execute as folder-hooks or accounts, i.e., it can only be called from macros that were called.
source_if [Only new quoting rules] The difference to source (beside not supporting pipe syntax aka shell command input) is that this command will not generate an error nor warn if the given file argument cannot be opened successfully.
spamclear [Option] Takes a list of messages and clears their ‘is-spam’ flag.
spamforget [Option] Takes a list of messages and causes the spam-interface to forget it has ever used them to train its Bayesian filter. Unless otherwise noted the ‘is-spam’ flag of the message is inspected to chose whether a message shall be forgotten to be “ham” or “spam”.
spamham   [Option] Takes a list of messages and informs the Bayesian filter of the spam-interface that they are “ham”.  This also clears the ‘is-spam’ flag of the messages in question.
spamrate  [Option] Takes a list of messages and rates them using the configured spam-interface, without modifying the messages, but setting their ‘is-spam’ flag as appropriate; because the spam rating headers are lost the rate will be forgotten once the mailbox is left.  Refer to the manual section Handling spam for the complete picture of spam handling in Mail.
spamset   [Option] Takes a list of messages and sets their ‘is-spam’ flag.
spamspam  [Option] Takes a list of messages and informs the Bayesian filter of the spam-interface that they are “spam”.  This also sets the ‘is-spam’ flag of the messages in question.
thread    [Obsolete] The same as ‘sort thread’ (consider using a ‘commandalias’ as necessary).
tls       [Only new quoting rules] TLS information and management command multiplexer to aid in Encrypted network communication, mostly available only if the term ‘,+sockets,’ is included in features. Commands support vput if so documented (see Command modifiers). The result that is shown in case of errors is always the empty string, errors can be identified via the error number !.  For example, string length overflows are caught and set ! to ^ERR-OVERFLOW.  The TLS configuration is honoured, especially tls-verify.
? vput tls result fingerprint pop3s://ex.am.ple ? echo $?/$!/$^ERRNAME: $result
certchain Show the complete verified peer certificate chain. Includes informational fields in conjunction with verbose.
certificate Show only the peer certificate, without any signers. Includes informational fields in conjunction with verbose.
fingerprint Show the tls-fingerprint-digested fingerprint of the certificate of the given HOST (‘server:port’, where the port defaults to the HTTPS port, 443).  tls-fingerprint is actively ignored for the runtime of this command.
Top       Like top but always uses the headerpick ‘type’ slot for white- and blacklisting header fields.
top       (to) Takes a message list and types out the first toplines lines of each message on the user's terminal.  Unless a special selection has been established for the ‘top’ slot of the headerpick command, the only header fields that are displayed are ‘From:’, ‘To:’, ‘Cc:’, and ‘Subject:’.  Top will always use the ‘type’ headerpick selection instead.  It is possible to apply compression to what is displayed by setting topsqueeze.  Messages are decrypted and converted to the terminal character set if necessary.
touch     (tou) Takes a message list and marks the messages for saving in the secondary mailbox MBOX.  Mail deviates from the POSIX standard with this command, as a following next command will display the following message instead of the current one.
Type      (T) Like type but also displays header fields which would not pass the headerpick selection, and all visualizable parts of MIME ‘multipart/alternative’ messages.
type      (t) Takes a message list and types out each message on the user's terminal.  The display of message headers is selectable via headerpick.  For MIME multipart messages, all parts with a content type of ‘text’, all parts which have a registered MIME type handler (see HTML mail and MIME attachments) which produces plain text output, and all ‘message’ parts are shown, others are hidden except for their headers.  Messages are decrypted and converted to the terminal character set if necessary.  The command mimeview can be used to display parts which are not displayable as plain text.
unaccount See account.
unalias   (una) See alias.
unanswered See answered.
unbind    See bind.
uncollapse See collapse.
uncolour  See colour.
undefine  See define.
undelete  See delete.
undraft   See draft.
unflag    See flag.
unfwdignore [Obsolete] Superseded by the multiplexer headerpick.
unfwdretain [Obsolete] Superseded by the multiplexer headerpick.
unignore  Superseded by the multiplexer headerpick.
unmimetype See mimetype.
unmlist   See mlist.
unmlsubscribe See mlsubscribe.
Unread    Same as unread.
unread    Takes a message list and marks each message as not having been read.
unretain  Superseded by the multiplexer headerpick.
unsaveignore [Obsolete] Superseded by the multiplexer headerpick.
unsaveretain [Obsolete] Superseded by the multiplexer headerpick.
unset     [Only new quoting rules] (uns) See set.
unshortcut See shortcut.
unsort    See short.
unthread  [Obsolete] Same as unsort.
urlcodec  Perform URL percent codec operations on the raw-data argument, rather according to RFC 3986.  The first argument specifies the operation: e[ncode] or d[ecode] perform plain URL percent en- and decoding, respectively.  p[ath]enc[ode] and p[ath]dec[ode] perform a slightly modified operation which should be better for pathnames: it does not allow a tilde ‘~’, and will neither accept hyphen-minus ‘-’ nor dot ‘’.  as an initial character.  The remains of the line form the URL data which is to be converted. This is a character set agnostic operation, and it may thus decode bytes which are invalid in the current ttycharset.
Supports vput (see Command modifiers), and manages the error number !.  If the coding operation fails the error number ! is set to ^ERR-CANCELED, and the unmodified input is used as the result; the error number may change again due to output or result storage errors.  [v15 behaviour may differ] This command does not know about URLs beside what is documented.  (vexpr offers a makeprint subcommand, shall the URL be displayed.)
varshow   [Only new quoting rules] This command produces the same output as the listing mode of set, including verboseity adjustments, but only for the given variables.
verify    [Option] Takes a message list and verifies each message.  If a message is not a S/MIME signed message, verification will fail for it.  The verification process checks if the message was signed using a valid certificate, if the message sender's email address matches one of those contained within the certificate, and if the message content has been altered.
version   Shows the version and features of Mail, optionally in a more verbose form which also includes the build and running system environment.  This command supports vput (see Command modifiers).
vexpr     [Only new quoting rules] A multiplexer command which offers signed 64-bit numeric calculations, as well as other, mostly string-based operations.  C-style byte string operations are available via csop.  The first argument defines the number, type, and meaning of the remaining arguments.  An empty number argument is treated as 0.  Supports vput (see Command modifiers).  The result shown in case of errors is ‘-1’ for usage errors and numeric operations, the empty string otherwise; “soft” errors, like when a search operation failed, will also set the ! error number to ^ERR-NODATA.  Except when otherwise noted numeric arguments are parsed as signed 64-bit numbers, and errors will be reported in the error number ! as the numeric error ^ERR-RANGE.
Numeric operations work on one or two signed 64-bit integers. Numbers prefixed with ‘0x’ or ‘0X’ are interpreted as hexadecimal (base 16) numbers, whereas ‘0’ indicates octal (base 8), and ‘0b’ as well as ‘0B’ denote binary (base 2) numbers.  It is possible to use any base in between 2 and 36, inclusive, with the ‘BASE#number’ notation, where the base is given as an unsigned decimal number, so ‘16#AFFE’ is a different way of specifying a hexadecimal number.  Unsigned interpretation of a number can be enforced by prefixing an ‘u’ (case-insensitively), as in ‘u-110’; this is not necessary for power-of-two bases (2, 4, 8, 16 and 32), which will be interpreted as unsigned by default, but it still makes a difference regarding overflow detection and overflow constant.  It is possible to enforce signed interpretation by (instead) prefixing a ‘s’ (case-insensitively). The number sign notation uses a permissive parse mode and as such supports complicated conditions out of the box:
? wysh set ifs=:;read i;unset ifs;echo $i;vexpr pb 2 10#$i -009 <   -009> 0b1001
One integer is expected by assignment (equals sign ‘=’), which does nothing but parsing the argument, thus detecting validity and possible overflow conditions, unary not (tilde ‘~’), which creates the bitwise complement, and unary plus and minus.  Two integers are used by addition (plus sign ‘+’), subtraction (hyphen-minus ‘-’), multiplication (asterisk ‘*’), division (solidus ‘/’) and modulo (percent sign ‘%’), as well as for the bitwise operators logical or (vertical bar ‘|’, to be quoted) , bitwise and (ampersand ‘&’, to be quoted) , bitwise xor (circumflex ‘^’), the bitwise signed left- and right shifts (‘<<’, ‘>>’), as well as for the unsigned right shift ‘>>>’.
Another numeric operation is pbase, which takes a number base in between 2 and 36, inclusive, and will act on the second number given just the same as what equals sign ‘=’ does, but the number result will be formatted in the base given, as a signed 64-bit number unless unsigned interpretation of the input number had been forced (with an u prefix).
Numeric operations support a saturated mode via the question mark ‘?’ modifier suffix; the keyword ‘saturated’ is optional, ‘+?’, ‘+?satu’, and ‘+?saturated’ are therefore identical.  In saturated mode overflow errors and division and modulo by zero are no longer reported via the exit status, but the result will linger at the minimum or maximum possible value, instead of overflowing (or trapping).  This is true also for the argument parse step.  For the bitwise shifts, the saturated maximum is 63. Any caught overflow will be reported via the error number ! as ^ERR-OVERFLOW.
? vput vexpr res -? +1 -9223372036854775808 ? echo $?/$!/$^ERRNAME:$res 0/75/OVERFLOW:-9223372036854775808
Character set agnostic string functions have no notion of locale settings and character sets.
date-utc  Outputs the current date and time in UTC (Coordinated Universal Time) with values named such that ‘vput vexpr x date-utc; eval wysh set $x’ creates accessible variables.
date-stamp-utc Outputs a RFC 3339 internet date/time format of UTC.
epoch     The seconds and nanoseconds since the Unix epoch (1970-01-01T00:00:00) named ‘epoch_sec’ and ‘epoch_nsec’ such that ‘vput vexpr x epoch; eval wysh set $x’ creates accessible variables.
file-expand Performs the usual Filename transformations on its argument.
file-stat, file-lstat Perform the usual Filename transformations on the argument, then call stat(2) and lstat(2), respectively, and output values such that ‘vput vexpr x file-stat FILE; eval wysh set $x’ creates accessible variables.  The variable ‘st_type’ uses solidus ‘/’ to denote directories, commercial at ‘@’ for links, number sign ‘#’ for block devices, percent sign ‘%’ for for character devices, vertical bar ‘|’ for FIFOs, equal sign ‘=’ for sockets, and the period ‘.’ for the rest.
random    Generates a random string of the given length, or of PATH_MAX bytes (a constant from /usr/include) if the value 0 is given; the random string will be base64url encoded according to RFC 4648, and thus be usable as a (portable) filename.
String operations work, sufficient support provided, according to the active user's locale encoding and character set (see Character sets).  Where the question mark ‘?’ modifier suffix is supported, a case-insensitive operation mode is available; the keyword ‘case’ is optional, ‘regex?’ and ‘regex?case’ are therefore identical.
makeprint (One-way) Converts the argument to something safely printable on the terminal.
regex     [Option] A string operation that will try to match the first argument with the regular expression given as the second argument.  ‘?’ modifier suffix is supported.  If the optional third argument has been given then instead of showing the match offset a replacement operation is performed: the third argument is treated as if specified within dollar-single-quote (see Shell-style argument quoting), and any occurrence of a positional parameter, for example 0, 1 etc. is replaced with the according match group of the regular expression:
? vput vexpr res regex bananarama \ (.*)NanA(.*) '\${1}au\$2' ? echo $?/$!/$^ERRNAME:$res: 1/61/NODATA:: ? vput vexpr res regex?case bananarama \ (.*)NanA(.*) '\${1}uauf\$2' ? echo $?/$!/$^ERRNAME:$res: 0/0/NONE:bauauframa:
vpospar   [Only new quoting rules] Manage the positional parameter stack (see 1, #, *, @ as well as shift).  If the first argument is ‘clear’, then the positional parameter stack of the current context, or the global one, if there is none, is cleared.  If it is ‘set’, then the remaining arguments will be used to (re)create the stack, if the parameter stack size limit is excessed an ^ERR-OVERFLOW error will occur.
If the first argument is ‘quote’, a round-trip capable representation of the stack contents is created, with each quoted parameter separated from each other with the first character of ifs, and followed by the first character of if-ws, if that is not empty and not identical to the first.  If that results in no separation at all a space character is used.  This mode supports vput (see Command modifiers).  I.e., the subcommands ‘set’ and ‘quote’ can be used (in conjunction with eval) to (re)create an argument stack from and to a single variable losslessly.
? vpospar set hey, "'you    ", world! ? echo $#: <${1}><${2}><${3}> ? vput vpospar x quote ? vpospar clear ? echo $#: <${1}><${2}><${3}> ? eval vpospar set ${x} ? echo $#: <${1}><${2}><${3}>
visual    (v) Takes a message list and invokes the VISUAL display editor on each message.  Modified contents are discarded unless the writebackedited variable is set, and are not used unless the mailbox can be written to and the editor returns a successful exit status.  edit can be used instead for a less display oriented editor.
write     (w) For conventional messages the body without all headers is written.  The original message is never marked for deletion in the originating mail folder.  The output is decrypted and converted to its native format as necessary.  If the output file exists, the text is appended.  If a message is in MIME multipart format its first part is written to the specified file as for conventional messages, handling of the remains depends on the execution mode.  No special handling of compressed files is performed.
In interactive mode the user is consecutively asked for the filenames of the processed parts.  For convenience saving of each part may be skipped by giving an empty value, the same result as writing it to /dev/null.  Shell piping the part content by specifying a leading vertical bar ‘|’ character for the filename is supported.  Other user input undergoes the usual Filename transformations, including shell pathname wildcard pattern expansions (glob(7)) and shell variable expansion for the message as such, not the individual parts, and contents of the destination file are overwritten if the file previously existed. Character set conversion to ttycharset is performed when saving text data.
[v15 behaviour may differ] In non-interactive mode any part which does not specify a filename is ignored, and suspicious parts of filenames of the remaining parts are URL percent encoded (as via urlcodec) to prevent injection of malicious character sequences, resulting in a filename that will be written into the current directory.  Existing files will not be overwritten, instead the part number or a dot are appended after a number sign ‘#’ to the name until file creation succeeds (or fails due to other reasons).
xcall     [Only new quoting rules] The sole difference to call is that the new macro is executed in place of the current one, which will not regain control: all resources of the current macro will be released first.  This implies that any setting covered by localopts will be forgotten and covered variables will become cleaned up.  If this command is not used from within a called macro it will silently be (a more expensive variant of) call.
xit       (x) A synonym for exit.
z         [Only new quoting rules] Mail presents message headers in screenfuls as described under the headers command.  Without arguments this command scrolls to the next window of messages, likewise if the argument is ‘+’.  An argument of ‘-’ scrolls to the last, ‘^’ scrolls to the first, and ‘$’ to the last screen of messages.  A number argument prefixed by ‘+’ or ‘-’ indicates that the window is calculated in relation to the current position, and a number without a prefix specifies an absolute position.
Z         [Only new quoting rules] Similar to z, but scrolls to the next or previous window that contains at least one ‘new’ or flagged message.
Command escapes are available in Compose mode during interactive usage, when explicitly requested via -~, and in batch mode (-#).  They perform special functions, like editing headers of the message being composed, calling normal COMMANDS, yielding a shell, etc.  Command escapes are only recognized at the beginning of lines, and consist of an escape followed by a command character.  The default escape character is the tilde ‘~’.
Unless otherwise documented command escapes ensure proper updates of the error number ! and the exit status ?.  The variable errexit controls whether a failed operation errors out message compose mode and causes program exit.  Escapes may be prefixed by none to multiple single character command modifiers, interspersed whitespace is ignored:
•   An effect equivalent to the command modifier ignerr can be achieved with hyphen-minus ‘-’, overriding errexit.
•   The modifier dollar ‘$’ evaluates the remains of the line; also see Shell-style argument quoting.  [v15 behaviour may differ] For now the entire input line is evaluated as a whole; to avoid that control operators like semicolon ; are interpreted unintentionally, they must be quoted.
Addition of the command line to the [Option]al history can be prevented by placing whitespace directly after escape.  The [Option]al key bindings support a compose mode specific context.  The following command escapes are supported:
~~ string Insert the string of text in the message prefaced by a single ‘~’.  (If the escape character has been changed, that character must be doubled instead.)
~! command Execute the indicated shell command which follows, replacing unescaped exclamation marks with the previously executed command if the internal variable bang is set, then return to the message.
~.        End compose mode and send the message.  The hooks on-compose-splice-shell and on-compose-splice, in order, will be called when set, after which, in interactive mode askatend (leading to askcc, askbcc) and askattach will be checked as well as asksend, after which a set on-compose-leave hook will be called, autocc and autobcc will be joined in if set, finally a given message-inject-tail will be incorporated, after which the compose mode is left.
~: Mail-command or ~_ Mail-command Can be used to execute COMMANDS (which are allowed in compose mode).
~< filename Identical to ~r.
~<! command command is executed using the shell.  Its standard output is inserted into the message.
~?        [Option] Write a summary of command escapes.
~@ [filename...] Append or edit the list of attachments.  Does not manage the error number ! and the exit status ? (please use ~^ if error handling is necessary).  The append mode expects a list of filename arguments as shell tokens (see Shell-style argument quoting; token-separating commas are ignored, too), to be interpreted as documented for the command line option -a, with the message number exception as below.
Without filename arguments the attachment list is edited, entry by entry; if a filename is left empty, that attachment is deleted from the list; once the end of the list is reached either new attachments may be entered or the session can be quit by committing an empty “new” attachment.  In non-interactive mode or in batch mode (-#) the list of attachments is effectively not edited but instead recreated; again, an empty input ends list creation.
For all modes, if a given filename solely consists of the number sign ‘#’ followed by either a valid message number of the currently active mailbox, or by a period ‘.’, referring to the current message of the active mailbox, the so-called “dot”, then the given message is attached as a ‘message/rfc822’ MIME message part.  The number sign must be quoted to avoid misinterpretation as a shell comment character.
~| command Pipe the message text through the specified filter command.  If the command gives no output or terminates abnormally, retain the original text of the message.  The command fmt(1) is often used as a rejustifying filter.
If the first character of the command is a vertical bar, then the entire message including header fields is subject to the filter command, so ‘~|| echo Fcc: /tmp/test; cat’ will prepend a file- carbon-copy message header.  Also see ~e, ~v.
~^ cmd [subcmd [arg3 [arg4]]] Low-level compose mode command which shares semantics with digmsg, and therefore evaluates its command line as documented in Shell-style argument quoting.  Does not manage the error number ! and the exit status ?: errors are handled via the protocol, and hard errors like I/O failures cannot be handled.
The protocol consists of command lines followed by (a) response line(s).  The first field of the response line represents a status code which specifies whether a command was successful or not, whether result data is to be expected, and if, the format of the result data.  Response data will be shell quoted as necessary for consumption by readsh, or eval and vpospar, to name a few. Error status code lines may optionally contain additional context:
‘210’     Status ok; the remains of the line are the result. ‘211’     Status ok; the rest of the line is optionally used for more status.  What follows are lines of result addresses, terminated by an empty line.  All the input, including the empty line, must be consumed before further commands can be issued.  Address lines consist of two token, first the plain network address, e.g., ‘bob@exam.ple’, followed by the (quoted) full address as known: ‘'(Lovely) Bob <bob@exam.ple>'’.  Non-network addresses use the first field to indicate the type (hyphen-minus ‘-’ for files, vertical bar ‘|’ for pipes, and number sign ‘#’ for names which will undergo alias processing) instead, the actual value will be in the second field. ‘212’     Status ok; the rest of the line is optionally used for more status.  What follows are lines of furtherly unspecified (quoted) string content, terminated by an empty line.  All the input, including the empty line, must be consumed before further commands can be issued. ‘500’     Syntax error; invalid command. ‘501’     Syntax error in parameters or arguments. ‘505’     Error: an argument fails verification.  For example an invalid address has been specified (also see expandaddr), or an attempt was made to modify anything in Mail's own namespace, or a modifying subcommand has been used on a read-only message. ‘506’     Error: an otherwise valid argument is rendered invalid due to context.  For example, a second address is added to a header which may consist of a single address only.
If a command indicates failure then the message will have remained unmodified.  Most commands can fail with ‘500’ if required arguments are missing, or excessive arguments have been given (false command usage).  ([v15 behaviour may differ] The latter does not yet occur regularly, because as stated in Shell-style argument quoting our argument parser is not yet smart enough to work on subcommand base; for example one might get excess argument error for a three argument subcommand that receives four arguments, but not for a four argument subcommand which receives six arguments: here excess will be joined.)  The following (case-insensitive) commands are supported:
attachment This command allows listing, removal and addition of message attachments.  The second argument specifies the subcommand to apply, one of:
attribute This uses the same search mechanism as described for remove and prints any known attributes of the first found attachment via ‘212’ upon success or ‘501’ if no such attachment can be found.  The attributes are written as lines with a keyword and a value token.
attribute-at This uses the same search mechanism as described for remove-at and is otherwise identical to attribute.
attribute-set This uses the same search mechanism as described for remove, and will set the attribute given as the fourth to the value given as the fifth token argument.  If the value is an empty token, then the given attribute is removed, or reset to a default value if existence of the attribute is crucial.
It returns via ‘210’ upon success, with the index of the found attachment following, ‘505’ for message attachments or if the given keyword is invalid, and ‘501’ if no such attachment can be found.  The following keywords may be used (case-insensitively):
‘filename’  Sets the filename of the MIME part, i.e., the name that is used for display and when (suggesting a name for) saving (purposes). ‘content-description’ Associate some descriptive information to the attachment's content, used in favour of the plain filename by some MUAs. ‘content-id’ May be used for uniquely identifying MIME entities in several contexts; this expects a special reference address format as defined in RFC 2045 and generates a ‘505’ upon address content verification failure. ‘content-type’ Defines the media type/subtype of the part, which is managed automatically, but can be overwritten. ‘content-disposition’ Automatically set to the string ‘attachment’.
attribute-set-at This uses the same search mechanism as described for remove-at and is otherwise identical to attribute-set.
insert    Adds the attachment given as the third argument, specified exactly as documented for the command line option -a, and supporting the message number extension as documented for ~@. This reports ‘210’ upon success, with the index of the new attachment following, ‘505’ if the given file cannot be opened, ‘506’ if an on-the-fly performed character set conversion fails, otherwise ‘501’ is reported; this is also reported if character set conversion is requested but not available.
list      List all attachments via ‘212’, or report ‘501’ if no attachments exist.  This command is the default command of attachment if no second argument has been given.
remove    This will remove the attachment given as the third argument, and report ‘210’ upon success or ‘501’ if no such attachment can be found. If there exists any path component in the given argument, then an exact match of the path which has been used to create the attachment is used directly, but if only the basename of that path matches then all attachments are traversed to find an exact match first, and the removal occurs afterwards; if multiple basenames match, a ‘506’ error occurs.  Message attachments are treated as absolute pathnames.
If no path component exists in the given argument, then all attachments will be searched for ‘filename=’ parameter matches as well as for matches of the basename of the path which has been used when the attachment has been created; multiple matches result in a ‘506’.
remove-at This will interpret the third argument as a number and remove the attachment at that list position (counting from one!), reporting ‘210’ upon success or ‘505’ if the argument is not a number or ‘501’ if no such attachment exists.
header   This command allows listing, inspection, and editing of message headers.  Header name case is not normalized, so that case-insensitive comparison should be used when matching names.  The second argument specifies the subcommand to apply, one of:
insert    Create a new or an additional instance of the header given in the third argument, with the header body content as given in the fourth token.  It may return ‘501’ if the third argument specifies a free-form header field name that is invalid, or if body content extraction fails to succeed, ‘505’ if any extracted address does not pass syntax and/or security checks or on Mail namespace violations, and ‘506’ to indicate prevention of excessing a single-instance header — note that ‘Subject:’ can be appended to (a space separator will be added automatically first). ‘To:’, ‘Cc:’ and ‘Bcc:’ support the ‘?single’ modifier to enforce treatment as a single addressee, for example ‘header insert To?single: 'exa, <m@ple>'’; the word ‘single’ is optional.
‘210’ is returned upon success, followed by the name of the header and the list position of the newly inserted instance.  The list position is always 1 for single-instance header fields.  All free-form header fields are managed in a single list; also see customhdr.
list      Without a third argument a list of all yet existing headers is given via ‘210’; this command is the default command of header if no second argument has been given.  A third argument restricts output to the given header only, which may fail with ‘501’ if no such field is defined.
remove    This will remove all instances of the header given as the third argument, reporting ‘210’ upon success, ‘501’ if no such header can be found, and ‘505’ on Mail namespace violations.
remove-at This will remove from the header given as the third argument the instance at the list position (counting from one!) given with the fourth argument, reporting ‘210’ upon success or ‘505’ if the list position argument is not a number or on Mail namespace violations, and ‘501’ if no such header instance exists.
show      Shows the content of the header given as the third argument.  Dependent on the header type this may respond with ‘211’ or ‘212’; any failure results in ‘501’.
In compose-mode read-only access to optional pseudo headers in the Mail private namespace is available:
‘Mailx-Command:’ The name of the command that generates the message, one of ‘forward’, ‘Lreply’, ‘mail’, ‘Reply’, ‘reply’, ‘resend’.  This pseudo header always exists (in compose-mode). ‘Mailx-Raw-To:’ ‘Mailx-Raw-Cc:’ ‘Mailx-Raw-Bcc:’ Represent the frozen initial state of these headers before any transformation (alias, alternates, recipients-in-cc etc.) took place. ‘Mailx-Orig-Sender:’ ‘Mailx-Orig-From:’ ‘Mailx-Orig-To:’ ‘Mailx-Orig-Cc:’ ‘Mailx-Orig-Bcc:’ The values of said headers of the original message which has been addressed by any of reply, forward, resend.  The sender field is special as it is filled in with the sole sender according to RFC 5322 rules, it may thus be equal to the from field.
help, ?  Show an abstract of the above commands via ‘211’.
version  This command will print the protocol version via ‘210’.
~A        The same as ‘~i Sign’.
~a        The same as ‘~i sign’.
~b name ... Add the given names to the list of blind carbon copy recipients.
~c name ... Add the given names to the list of carbon copy recipients.
~d        Read the file specified by the DEAD variable into the message.
~e        Invoke the text EDITOR on the message collected so far, then return to compose mode.  ~v can be used for a more display oriented editor, and ~|| offers a pipe-based editing approach.
~F messages Read the named messages into the message being sent, including all message headers and MIME parts, and honouring forward-add-cc as well as forward-inject-head and forward-inject-tail.  If no messages are specified, read in the current message, the “dot”.
~f messages Read the named messages into the message being sent.  If no messages are specified, read in the current message, the “dot”. Strips down the list of header fields according to the ‘forward’ (with posix: ‘type’) white- and blacklist selection of headerpick, and honours forward-add-cc as well as forward-inject-head and forward-inject-tail.  For MIME multipart messages, only the first displayable part is included.
~H        In interactive mode, edit the message header fields ‘From:’, ‘Reply-To:’ and ‘Sender:’ by typing each one in turn and allowing the user to edit the field.  The default values for these fields originate from the from, reply-to and sender variables.  In non- interactive mode this sets ^ERR-NOTTY.
~h        In interactive mode, edit the message header fields ‘To:’, ‘Cc:’, ‘Bcc:’ and ‘Subject:’ by typing each one in turn and allowing the user to edit the field.  In non-interactive mode this sets ^ERR-NOTTY.
~I variable Insert the value of the specified variable into the message.  The message remains unaltered if the variable is unset or empty.  Any embedded character sequences ‘\t’ horizontal tabulator and ‘\n’ line feed are expanded in posix mode; otherwise the expansion should occur at set time ([v15 behaviour may differ] by using the command modifier wysh).
~i variable Like ~I, but appends a newline character.
~M messages Read the named messages into the message being sent, indented by indentprefix.  If no messages are specified, read the current message, the “dot”.  Honours forward-add-cc as well as forward-inject-head and forward-inject-tail.
~m messages Read the named messages into the message being sent, indented by indentprefix.  If no messages are specified, read the current message, the “dot”.  Strips down the list of header fields according to the ‘type’ white- and blacklist selection of headerpick.  Honours forward-add-cc as well as forward-inject-head and forward-inject-tail.  For MIME multipart messages, only the first displayable part is included.
~p        Display the message collected so far, prefaced by the message header fields and followed by the attachment list, if any.
~Q        Read in the given / current message(s) using the algorithm of quote (except that is implicitly assumed, even if not set), honouring quote-add-cc.
~q        Abort the message being sent, copying it to the file specified by the DEAD variable if save is set.
~R filename Identical to ~r, but indent each line that has been read by indentprefix.
~r filename [HERE-delimiter] Read the named file, object to Filename transformations excluding shell globs and variable expansions, into the message; if filename is the hyphen-minus ‘-’ then standard input is used (for pasting, for example).  Only in this latter mode HERE-delimiter may be given: if it is data will be read in until the given HERE-delimiter is seen on a line by itself, and encountering EOF is an error; the HERE-delimiter is a required argument in non- interactive mode; if it is single-quote quoted then the pasted content will not be expanded, [v15 behaviour may differ] otherwise a future version of Mail may perform shell-style expansion on the content.
~s string Cause the named string to become the current subject field. Newline (NL) and carriage-return (CR) bytes are invalid and will be normalized to space (SP) characters.
~t name ... Add the given name(s) to the direct recipient list.
~U messages Read in the given / current message(s) excluding all headers, indented by indentprefix.  Honours forward-add-cc as well as forward-inject-head and forward-inject-tail.
~u messages Read in the given / current message(s), excluding all headers. Honours forward-add-cc as well as forward-inject-head and forward-inject-tail.
~v        Invoke the VISUAL editor on the message collected so far, then return to compose mode.  ~e can be used for a less display oriented editor, and ~|| offers a pipe-based editing approach.