Home > Help Files > Email > Tilde

Tilde


			
			Using Tilde Escapes in Mail

			      May 27, 1984


     When you are sending a message, either from the prompt ("&") of
the mail program, or from the shell, tilde escapes are a way of
excercising some control over your message.

     A "tilde escape" is called that because it is a command which
begins with a tilde character -- "~" -- and has a special meaning
to the "mail" program.  Tilde escapes are valid only when sending
mail, and do not work at other times.

MAIL HEADERS: SUBJECTS AND ALL THAT

     When a message is sent, it always has a header -- that is,
a block of information at the start of the message which tells who
the message is from, who it is to, the time it was sent, etc.  Much
of this information is provided by the system automatically, such
as the "From" and "Date" lines.  Certain fields, however, are the
user's responsibility to provide.  Examples of these fields would
be the "To" line (which you give when you give the command, say,
"mail phil" -- "phil" is the "To" line), and the subject of the
message.  Tilde escapes allow you to further specify information
in the header.

     For example, it is a good idea to give every message a subject.
This can be accomplished with the "~s" escape, which is used like
this:

	% mail username
	~s The subject of the message goes here
	[The body of the
	message goes here]
	

     People can be added to the "To" list with the "~t" escape.
For example, if you entered the command

	% mail foo

but then realized you also wanted to send the message to "bar",
you could then type the command

~t bar

which would add the user "bar" to the "To" field of the header.

     Often, for "political" reasons, you may want to send a
message to a certain person who is directly involved in a matter,
but allow the message to be sent to other individuals who have
some cursory bearing on the matter.  The "~c" (carbon copy)
command allows this.  For example, to send a note to "zot"
and carbon copy of the message to "frob", the commands

	% mail zot
	~c frob

would do the trick.  Note that when "zot" and "frob" received the
message, they would find the line "Cc: frob" in the header of
the message.

     To display what has been entered in the letter so far (and also
as a way to see what the header looks like), the command "~p"
(print) will display the letter so far.

READING FILES

     If you used an editor such as "ex" or "vi" to prepare a
letter, or if you wish to mail a program listing, the "~r" (read)
command will come in handy.  It can be used to read in a file
in the following manner:

	mail username
	~r filename

This will cause "filename" to be read into the message.

EDITING OUTGOING MAIL

     You may find you have made a mistake in a message you are sending,
and you'd like to edit out the mistake.  This can be done with
"~e", which invokes "ex", the line oriented editor, or "~v",
which invokes the screen editor "vi" on the message.

     After you have edited the message to your satisfaction, you
should exit the editor with "ZZ" in "vi", or "wq" in "ex".  You
will then be placed back into the message-entry portion of the
"mail" command.

STILL MORE

     There are too many tilde escapes to list in full detail here.
However, the command "~?" in mail will produce a brief summary of
all the tilde escapes and their functions.

 


Comments to consult@newton.berkeley.edu
© 1998-2009 UC Regents