BSD 3 development
[unix-history] / usr / doc / mail / mail7.nr
CommitLineData
63a97d5d
KS
1.de SF \" Give short form of a command (from $1)
2[\\$1]
3..
4.sh 1 "Summary of commands, escapes, and options"
5.pp
6This sections describes tersely all of the Mail commands,
7escapes, and options.
8For each command,
9its most abbreviated form (in brackets) and a
10short description of the command is given below.
11.pp
12First, message lists are computed by determining the set M which
13consists of all message referenced explicitly or through ranges.
14Then, the set U is computed, which consists of all messages sent by
15.i any
16of the user names specified. Finally, the message list is calculated
17by finding the intersection of sets M and U.
18.pp
19Each Mail command is typed on a line by itself, and may take arguments
20following the command word. The command need not be typed in its
21entirety \*- the first command which matches the typed prefix is used.
22If the argument begins with a digit or special character, then
23no space is required following the command letter, but otherwise the space
24is required. If a Mail command does not take arguments, they may be
25specified, even though they are ignored. For the commands which take
26message lists as arguments, if no message list is given, then the
27next message forward which satisfies the command's requirements is
28used. If there are no messages forward of the current message,
29the search proceeds backwards, and if there are no good messages
30at all, Mail types \*(lqNo applicable messages\*(rq and aborts the
31command.
32.nr ii 12n
33.ip \-
34.SF \-
35Goes to the previous message and prints it out. If given
36a numeric argument
37.i n ,
38goes to the
39.i n th
40previous message and prints it. If there is no previous
41message, it prints
42.q "Nonzero address required."
43.ip =
44.SF =
45Prints out the current message number. Takes no arguments.
46.ip ?
47.SF ?
48Prints out the file /usr/lib/Mail.help, which contains a brief summary
49of the commands. Takes no arguments.
50.ip !
51.SF !
52Executes the \s-2UNIX\s0 Shell command which follows. Unlike other commands,
53there does not need to be a space after the exclamation point.
54.ip alias
55.SF a
56With no arguments, prints out all currently-defined aliases. With one
57argument, prints out that alias. With more than one argument, adds the
58users named in the second and later arguments to the alias named in
59the first argument.
60.ip chdir
61.SF c
62Changes the user's working directory to that specified, if given. If
63no directory is given, then changes to the user's login directory.
64.ip delete
65.SF d
66Takes a list of messages as argument and marks them all as deleted.
67Deleted messages will not be saved in
68.i mbox ,
69nor will they be available for most other commands. Default messages may
70not be deleted already.
71.ip dp
72.SF dp
73Deletes the current message and prints the next message. If there is no
74next message, types out
75.q "At EOF."
76.ip dt
77.SF dt
78Same as
79.b dp .
80.ip edit
81.SF e
82Takes a list of messages and points the text editor at each one in
83turn. On return from the editor, the message is read back in. The default
84message for
85.b edit
86may not be saved or deleted.
87.ip exit
88.SF ex
89Effects an immediate return to the Shell without modifying
90the user's system mailbox, his
91.i mbox
92file, or his edit file in
93.b \-f .
94.ip from
95.SF f
96Takes a list of messages and prints their message headers. The default
97message is neither saved nor deleted.
98.ip headers
99.SF h
100Lists the current range of headers, which is an 18 message group. If
101the
102.q +
103argument is given, then the next 18 message group is printed, and
104if the
105.q \-
106argument is given, the previous 18 message group is printed.
107.ip help
108.SF hel
109A synonym for ?
110.ip hold
111.SF ho
112Takes a message list and marks each message therein to be saved in the
113user's system mailbox instead of in
114.i mbox.
115Does not override the
116.b delete
117command. The default message must not be deleted.
118.ip list
119.SF l
120The
121.b list
122command lists all of the available user commands in the order
123that the command processor sees them. It takes no arguments.
124.ip mail
125.SF m
126Takes as argument login names and distribution group names
127and sends mail to those people. Tilde escapes work in
128.b mail.
129.ip next
130.SF n
131Goes to the next message in sequence and types it. If a message
132list is given, then
133.b next
134goes to the first message in the message list.
135.ip preserve
136.SF pre
137A synonym for
138.b hold.
139.ip print
140.SF p
141Takes a message list and types out each message on the user's terminal.
142The default message must not be deleted.
143.ip quit
144.SF q
145Terminates the Mail session, saving all undeleted, unsaved messages
146in the user's
147.i mbox
148file in his login directory, preserving all messages marked with
149.b hold
150or
151.b preserve
152in his system mailbox, and removing all other messages from his
153system mailbox. If mail has arrived during the Mail session,
154the message \*(lqYou have new mail\*(rq is typed. If executing
155while editing a mailbox file with the
156.b \-f
157flag, then the edit file is rewritten. A return to the Shell is
158effected, unless the rewrite of edit file fails, in which case
159the user can escape with the
160.b exit
161command.
162.ip reply
163.SF r
164Takes a message list and sends mail to each message author
165just like the
166.b mail
167command. The default message must not be deleted.
168.ip respond
169.SF r
170A synonym for
171.b reply .
172.ip save
173.SF s
174Takes a message list and a filename and appends each message in turn to
175the end of the file. The filename in quotes, followed by the line count
176and character count is echoed on the user's terminal. The default message
177for
178.b save
179may not be saved or deleted.
180.ip set
181.SF se
182With no arguments, prints all variable values. Otherwise, sets option.
183Arguments are of the form
184.q "option=value"
185or
186.q option.
187.ip shell
188.SF sh
189Invokes an interactive version of the shell.
190.ip size
191.SF si
192Takes a message list and prints out the size in characters of
193each message. The default message for
194.b size
195must not be deleted.
196.ip top
197.SF to
198Takes a message list and prints the top so many lines. The number of lines
199printed is controlled by the variable
200.q toplines
201and defaults to five.
202.ip type
203.SF t
204A synonym for
205.b print .
206.ip unalias
207.SF una
208Takes a list of names defined by
209.b alias
210commands and discards the remembered groups of users. The group names
211no longer have any significance.
212.ip undelete
213.SF u
214Takes a message list and marks each one as
215.i not
216being deleted. Each message
217in the list must already be deleted. The default message must be deleted.
218.ip unset
219.SF uns
220Takes a list of option names and discards their remembered values;
221opposite of
222.b set .
223.ip visual
224.SF v
225Takes a message list and invokes the display editor on each one.
226.ip write
227.SF w
228A synonym for
229.b save .
230.ip xit
231.SF x
232A synonym for
233.b exit .
234.pp
235Recall that tilde escapes are used when composing messages to perform
236special functions. Tilde escapes are only recognized at the beginning
237of lines. The name
238.q tilde\ escape
239is somewhat of a misnomer since the actual escape character can be set
240by the option
241.q escape.
242.pp
243Here is a summary of the tilde escapes:
244.nr ii 16n
245.ip ~!command
246Execute the indicated shell command, then return to the message.
247.ip "~c name ..."
248Add the given names to the list of carbon copy recipients.
249.ip ~d
250Read the file
251.q dead.letter
252from your home directory into the message.
253.ip ~e
254Invoke the text editor on the message collected so far. After the
255editing session is finished, you may continue appending text to the
256message.
257.ip ~h
258Edit the message header fields by typing each one in turn and allowing the
259user to append text to the end or modify the field by using the current
260terminal erase and kill characters.
261.ip "~m messages"
262Read the named messages into the message being sent, shifted right one
263tab. If no messages are specified, read the current message.
264.ip ~p
265Print out the message collected so far, prefaced by the message header
266fields.
267.ip ~q
268Abort the message being sent, copying the message to
269.q "dead.letter"
270in your home directory if
271.q save
272is set.
273.ip "~r filename"
274Read the named file into the message.
275.ip "~s string"
276Cause the named string to become the current subject field.
277.ip "~t name ..."
278Add the given names to the direct recipient list.
279.ip "~v"
280Invoke an alternate editor (defined by the VISUAL option)
281on the message collected so far. Usually, the alternate editor will be a
282visual editor. After you quit the editor, you may resume appending
283text to the end of your message.
284.ip "~w filename"
285Write the message onto the named file.
286.ip "~|command"
287Pipe the message through the command as a filter. If the command
288gives no output or terminates abnormally, retain the original text
289of the message.
290.ip "~~string"
291Insert the string of text in the message prefaced by a single ~.
292If you have changed the escape character, then you should double
293.i that
294character in order to send it.
295.pp
296Options are controlled via the
297.b set
298and
299.b unset
300commands. Options may be either binary, in which case it is only
301significant to see whether they are set or not, or string, in which
302case it's actual value is of interest.
303.pp
304The binary options include the following:
305.ip append
306Causes messages saved in
307.i mbox
308to be appended to the end rather than prepended.
309.ip ask
310Causes Mail to prompt you for the subject of each message you send.
311If you respond with simply a newline, no subject field will be sent.
312.ip askcc
313Causes you to be prompted for additional carbon copy recipients at the
314end of each message. Responding with a newline indicates your
315satisfaction with the current list.
316.ip autoprint
317Causes the
318.b delete
319command to behave like
320.b dp
321\*- thus, after deleting a message, the next one will be typed
322automatically.
323.ip ignore
324Causes interrupt signals from your terminal to be ignored and echoed
325as @'s.
326.ip metoo
327Usually, when a group is expanded that contains the sender,
328the sender is removed from the expansion. Setting this option causes
329the sender to be included in the group.
330.ip quiet
331Suppresses the printing of the version when Mail is first invoked.
332.ip save
333Causes the message collected prior to a \s-2RUBOUT\s0 to be saved
334on the file
335.q dead.letter
336in your home directory on receipt of the \s-2RUBOUT\s0. Also causes
337the message to be so saved in the same fashion for ~q.
338.pp
339The following options have string values:
340.ip EDITOR
341Pathname of the text editor to use in the
342.b edit
343command and ~e escape. If not defined, then a default editor is used.
344.ip SHELL
345Pathname of the shell to use in the
346.rb !
347command and the ~! escape. A default shell is used if this option
348is not defined.
349.ip VISUAL
350Pathname of the text editor to use in the
351.b visual
352command
353and ~v escape.
354.ip escape
355If defined, the first character of this option gives the character to
356use in the place of ~ to denote escapes.
357.ip record
358If defined, gives the pathname of the file used to record all outgoing
359mail. If not defined, then outgoing mail is not so saved.
360.ip toplines
361If defined, gives the number of lines of a message to be printed out
362with the
363.b top
364command; normally, the first five lines are printed.