Commit | Line | Data |
---|---|---|
a80efa1b KS |
1 | .sh 1 "Tilde escapes" |
2 | .pp | |
3 | While typing in a message to be sent to others, it is often | |
4 | useful to be able to invoke the text editor on the partial message, | |
5 | print the message, execute a shell command, or perform some other | |
6 | auxiliary function. Mail provides these capabilities through | |
7 | .i "tilde escapes" , | |
8 | which consist of a tilde (~) at the beginning of a line, followed by | |
9 | a single character which indicates the function to be performed. For | |
10 | example, to print the text of the message so far, use: | |
11 | .(l | |
12 | ~p | |
13 | .)l | |
14 | which will print a line of dashes, the recipients of your message, and | |
15 | the text of the message so far. If you are dissatisfied with the message as | |
16 | it stands, you can invoke the text editor on it using the escape | |
17 | .(l | |
18 | ~e | |
19 | .)l | |
20 | which causes the message to be copied into a temporary file and an | |
21 | instance of the editor to be spawned. After modifying the message to | |
22 | your satisfaction, write it out and quit the editor. Mail will respond | |
23 | by typing | |
24 | .(l | |
25 | (continue) | |
26 | .)l | |
27 | after which you may continue typing text which will be appended to your | |
28 | message, or type <control-d> to end the message. | |
29 | .pp | |
30 | It is often useful to be able to include the contents of some | |
31 | file in your message; the escape | |
32 | .(l | |
33 | ~r filename | |
34 | .)l | |
35 | is provided for this purpose, and causes the named file to be appended | |
36 | to your current message. Mail complains if the file doesn't exist | |
37 | or can't be read. If the read is successful, the number of lines and | |
38 | characters appended to your message is printed, after which you may continue | |
39 | appending text. | |
40 | .pp | |
41 | As a special case of ~r, the escape | |
42 | .(l | |
43 | ~d | |
44 | .)l | |
45 | reads in the file | |
46 | .q dead.letter | |
47 | in your home directory. This is often useful since Mail copies the text | |
48 | of your message there when you abort a message with \s-2RUBOUT\s0. | |
49 | .pp | |
50 | In order to save the current text of your message on a file you may use the | |
51 | .(l | |
52 | ~w filename | |
53 | .)l | |
54 | escape. Mail will print out the number of lines and characters written | |
55 | to the file, after which you may continue appending text to your message. | |
56 | .pp | |
57 | If you are sending mail from within Mail's command mode (read about the | |
58 | .b reply | |
59 | and | |
60 | .b mail | |
61 | commands, section six), you can read a message sent to you into the message | |
62 | you are constructing with the escape: | |
63 | .(l | |
64 | ~m 4 | |
65 | .)l | |
66 | which will read message 4 into the current message, shifted right by | |
67 | one tab stop. You can name any non-deleted message, or list of messages. | |
68 | This is the usual way to forward a message. | |
69 | .pp | |
70 | If, in the process of composing a message, you decide to add additional | |
71 | people to the list of message recipients, you can do so with the escape | |
72 | .(l | |
73 | ~t name1 name2 ... | |
74 | .)l | |
75 | You may name as few or many additional recipients as you wish. Note | |
76 | that the users originally on the recipient list will still receive | |
77 | the message; in fact, you cannot remove someone from the recipient | |
78 | list with ~t. | |
79 | .pp | |
80 | If you wish, you can associate a subject with your message by using the | |
81 | escape | |
82 | .(l | |
83 | ~s Arbitrary string of text | |
84 | .)l | |
85 | which replaces any previous subject with | |
86 | .q "Arbitrary string of text." | |
87 | The subject, if given, is sent near the | |
88 | top of the message prefixed with | |
89 | .q "Subj:" | |
90 | You can see what the message will look like by using ~p. | |
91 | .pp | |
92 | For political reasons, one occasionally prefers to list certain | |
93 | people as recipients of carbon copies of a message rather than | |
94 | direct recipients. The escape | |
95 | .(l | |
96 | ~c name1 name2 ... | |
97 | .)l | |
98 | adds the named people to the | |
99 | .q "Cc:" | |
100 | list, similar to ~t. | |
101 | Again, you can execute ~p to see what the message will look like. | |
102 | .pp | |
103 | The recipients of the message together constitute the | |
104 | .q "To:" | |
105 | field, the subject the | |
106 | .q "Subj:" | |
107 | field, and the carbon copies the | |
108 | .q "Cc:" | |
109 | field. If you wish to edit these in ways impossible with the ~t, ~s, | |
110 | and ~c escapes, you can use the escape | |
111 | .(l | |
112 | ~h | |
113 | .)l | |
114 | which prints | |
115 | .q "To:" | |
116 | followed by the current list of recipients and leaves the cursor | |
117 | (or printhead) at the end of the line. If you type in ordinary | |
118 | characters, they are appended to the end of the current list of | |
119 | recipients. You can also use your erase character to erase back into | |
120 | the list of recipients, or your kill character to erase them altogether. | |
121 | Thus, for example, if your erase and kill characters are the standard | |
122 | # and @ symbols, | |
123 | .(l | |
124 | ~h | |
125 | To: root kurt####bill | |
126 | .)l | |
127 | would change the initial recipients | |
128 | .q "root kurt" | |
129 | to | |
130 | .q "root bill." | |
131 | When you type a newline, Mail advances to the | |
132 | .q "Subj:" | |
133 | field, where the same rules apply. Another newline brings you to | |
134 | the | |
135 | .q "Cc:" | |
136 | field, which may be edited in the same fashion. Another newline | |
137 | leaves you appending text to the end of your message. You can use | |
138 | ~p to print the current text of the header fields and the body | |
139 | of the message. | |
140 | .pp | |
141 | To effect a temporary escape to the shell, the escape | |
142 | .(l | |
143 | ~!command | |
144 | .)l | |
145 | is used, which executes | |
146 | .i command | |
147 | and returns you to mailing mode without altering the text of | |
148 | your message. If you wish, instead, to filter the body of your | |
149 | message through a shell command, then you can use | |
150 | .(l | |
151 | ~|command | |
152 | .)l | |
153 | which pipes your message through the command and uses the output | |
154 | as the new text of your message. If the command produces no output, | |
155 | Mail assumes that something is amiss and retains the old version | |
156 | of your message. A frequently-used filter is the command | |
157 | .i fmt | |
158 | which is designed to format outgoing mail. | |
159 | .pp | |
160 | If you wish (for some reason) to send a message which contains | |
161 | a line beginning with a tilde, you must double it. Thus, for example, | |
162 | .(l | |
163 | ~~This line begins with a tilde. | |
164 | .)l | |
165 | sends the line | |
166 | .(l | |
167 | ~This line begins with a tilde. | |
168 | .)l | |
169 | .pp | |
170 | Finally, the escape | |
171 | .(l | |
172 | ~? | |
173 | .)l | |
174 | prints out a brief summary of the available tilde escapes. |