mail.1 (2010 09)
m
mail(1) mail(1)
NAME
mail, rmail - send mail to users or read mail
SYNOPSIS
mail [+][-epqr][
-f file ]
mail [-dt] person ...
rmail [-dt] person ...
Remarks:
See mailx(1) and elm(1) for an enhanced user mail interface.
DESCRIPTION
The
mail command, when used without arguments, prints the user’s mail, message-by-message, in last-
in, first-out order.
For each message,
mail prints a
? prompt and reads a line from the standard input to determine the
disposition of the message. Commands that automatically proceed to the next message exit from
mail if
mail already on the last message.
Commands
mail supports the following commands:
<new-line> Go on to next message. Exit if already on last message.
+ Same as <new-line>.
n Same as <new-line>.
d Delete message and go on to next message.
p Print message again.
- Go back to previous message.
s [ files ] Save message in the named files (default is mbox), mark the message for deletion
from the user’s mailfile , and proceed to next message.
y [ files ] Same as s [ files ].
w [ files ] Save message without its header (the ‘‘From ...’’ line), in the named files (default is
mbox), mark the message for deletion, and go on to next message.
m person ... Mail the message to each named person , mark the message for deletion, and go on
to next message.
q Put undeleted mail back in the mailfile and stop.
EOT (Ctrl-D) Same as
q.
x Abort. Leave original mailfile unchanged and stop.
!command Escape to the command interpreter and execute command.
? Print a command summary.
* Same as ?.
Command-Line Options
The following command-line options alter printing of the mail:
+ Cause messages to be printed in first-in, first-out order.
-e Suppresses printing of mail and returns the exit value:
0 = Mail present
1 = No mail
2 = Other error
-p Prints all mail without prompting for disposition.
-q Causes mail to terminate if an interrupt is received. Normally an interrupt only
causes the termination of the printing of the current message.
HP-UX 11i Version 3: September 2010 − 1 − Hewlett-Packard Company 1