While typing in a message to be sent to others, it is often
useful to be able to invoke the text editor on the partial message,
print the message, execute a shell command, or perform some other
auxiliary function. Mail provides these capabilities through
which consist of a tilde (~) at the beginning of a line, followed by
a single character which indicates the function to be performed. For
example, to print the text of the message so far, use:
which will print a line of dashes, the recipients of your message, and
the text of the message so far. If you are dissatisfied with the message as
it stands, you can invoke the text editor on it using the escape
which causes the message to be copied into a temporary file and an
instance of the editor to be spawned. After modifying the message to
your satisfaction, write it out and quit the editor. Mail will respond
after which you may continue typing text which will be appended to your
message, or type <control-d> to end the message.
It is often useful to be able to include the contents of some
file in your message; the escape
is provided for this purpose, and causes the named file to be appended
to your current message. Mail complains if the file doesn't exist
or can't be read. If the read is successful, the number of lines and
characters appended to your message is printed, after which you may continue
As a special case of ~r, the escape
in your home directory. This is often useful since Mail copies the text
of your message there when you abort a message with \s-2RUBOUT\s0.
In order to save the current text of your message on a file you may use the
escape. Mail will print out the number of lines and characters written
to the file, after which you may continue appending text to your message.
If you are sending mail from within Mail's command mode (read about the
commands, section six), you can read a message sent to you into the message
you are constructing with the escape:
which will read message 4 into the current message, shifted right by
one tab stop. You can name any non-deleted message, or list of messages.
This is the usual way to forward a message.
If, in the process of composing a message, you decide to add additional
people to the list of message recipients, you can do so with the escape
You may name as few or many additional recipients as you wish. Note
that the users originally on the recipient list will still receive
the message; in fact, you cannot remove someone from the recipient
If you wish, you can associate a subject with your message by using the
~s Arbitrary string of text
which replaces any previous subject with
.q "Arbitrary string of text."
The subject, if given, is sent near the
top of the message prefixed with
You can see what the message will look like by using ~p.
For political reasons, one occasionally prefers to list certain
people as recipients of carbon copies of a message rather than
direct recipients. The escape
adds the named people to the
Again, you can execute ~p to see what the message will look like.
The recipients of the message together constitute the
field, and the carbon copies the
field. If you wish to edit these in ways impossible with the ~t, ~s,
and ~c escapes, you can use the escape
followed by the current list of recipients and leaves the cursor
(or printhead) at the end of the line. If you type in ordinary
characters, they are appended to the end of the current list of
recipients. You can also use your erase character to erase back into
the list of recipients, or your kill character to erase them altogether.
Thus, for example, if your erase and kill characters are the standard
would change the initial recipients
When you type a newline, Mail advances to the
field, where the same rules apply. Another newline brings you to
field, which may be edited in the same fashion. Another newline
leaves you appending text to the end of your message. You can use
~p to print the current text of the header fields and the body
To effect a temporary escape to the shell, the escape
and returns you to mailing mode without altering the text of
your message. If you wish, instead, to filter the body of your
message through a shell command, then you can use
which pipes your message through the command and uses the output
as the new text of your message. If the command produces no output,
Mail assumes that something is amiss and retains the old version
of your message. A frequently-used filter is the command
which is designed to format outgoing mail.
If you wish (for some reason) to send a message which contains
a line beginning with a tilde, you must double it. Thus, for example,
~~This line begins with a tilde.
~This line begins with a tilde.
prints out a brief summary of the available tilde escapes.