m

mail(1)

mail(1)

NAME

mail, rmail - send mail to users or read mail

SYNOPSIS

mail [+] [-epqr][-f ®le ]

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, ®rst-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>.

nSame as <new-line>.

dDelete message and go on to next message.

pPrint message again.

-Go back to previous message.

s [ files ]

Save message in the named ®les (default is mbox), mark the message for deletion

 

from the user's mail®le, and proceed to next message.

y [ files ]

Same as s [ ®les ].

w [ files ]

Save message without its header (the ``From ...'' line), in the named ®les (default is

 

mbox), mark the message for deletion, and go on to next message.

mperson ... Mail the message to each named person, mark the message for deletion, and go on to next message.

qPut undeleted mail back in the mailfile and stop.

EOT (Ctrl-D) Same as q.

xAbort. 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 ®rst-in, ®rst-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.

Section 1490

 

− 1 −

HP-UX Release 11i: December 2000