.TH msgs "" "" Command
.PC "Read messages intended for all \*(CO users"
\fBmsgs [\fI\-q\^\fB] [\fInumber\^\fB]\fR
.PP
.HS
.SH Options:
.IC \fB\-q\fR
Query if new message is waiting to be read
.IC \fInumber\fR
Print message titled with given \fInumber\fR
.Pp
To submit a message to \fBmsgs\fR, mail it to user \fBmsgs\fR.
.HE
\fBmsgs\fR selects and displays messages that are intended
to be read by all \*(CO users.
Messages are mailed to the login \fBmsgs\fR.
They should contain
information meant to be read once by most users of the system.
.PP
The command
.B msgs
normally is in a user's \fB.profile\fR,
so that it is executed every time he logs in.
When invoked,
it prompts the user with the identifier of the user who sent the message
and the message's size.
.B msgs
then asks the user if he wishes to see the rest of the message.
The user should reply with one of the following:
.DS
.ta 0.4i 1.5i
	\fBy\fR	Display the message.
	\fB<return>\fR	Display the message.
	\fBn\fR	Skip this message and go to the next one.
	\fB\-\fR	Redisplay the last message.
	\fBq\fR	Quit \fBmsgs\fR.
	\fInumber\fR	Display message \fInumber\fR; then continue.
.DE
.PP
If environmental variable
.B PAGER
is defined,
.B msgs
will \*(QLpipe\*(QR each message through the command specified in
.BR PAGER .
For example, the \fB.profile\fP command line:
.DM
	export PAGER="exec /bin/scat -1"
.DE
.PP
would invoke
.B /bin/scat
for each message with the command line argument
.B "-1"
(the digit one).
.PP
\fBmsgs\fR writes into the file \fB$(HOME)/.msgsrc\fR
the number of the next message the user will see
when he invokes \fBmsgs\fR.
\fBmsgs\fR keeps all messages in the directory \fB/usr/msgs\fR;
each message
is named with a sequential number, which indicates its message number.
The file \fB/usr/msgs/bounds\fR contains the low and high numbers of
the messages in the directory; \fBmsgs\fR determines whether a user
has not read a message by comparing the information in
\fB$(HOME)/.msgsrc\fR with that in \fB/usr/msgs/bounds\fR.
If the contents of \fB/usr/msgs/bounds\fR
are incorrect, the problem can be fixed by removing that file; \fBmsgs\fR
will create a new \fBbounds\fR file the next time it is run.
.PP
When the contents of a message are no longer needed,
simply remove that message.
Avoid removing the \fBbounds\fP file and the highest numbered message
at the same time.
.PP
.B msgs
accepts the following command-line options:
.RS
.IP \fB\-q\fR
Query whether there are messages; print \*(QLThere
are new messages\*(QR if there are, and \*(QLNo new messages\*(QR
if not.
The command \fBmsgs \-q\fR
is often used in profile scripts.
.IP \fInumber\fR
Start at message \fInumber\fR rather
than at the message recorded in \fB$(HOME)/.msgsrc\fR.
If \fInumber\fR is greater than zero, then start
with that message; if \fInumber\fR is less than zero, then
begin \fInumber\fR messages before the one recorded
in \fB$(HOME)/.msgsrc\fR.
.RE
.SH Files
\fB/usr/spool/mail/msgs\fR \(em Mail messages file
.br
\fB/usr/msgs/[1-9]*\fR \(em Data base
.br
\fB/usr/msgs/bounds\fR \(em File that contains message number bounds
.br
\fB$(HOME)/.msgsrc\fR \(em Number of next message to be presented
.SH "See Also"
.Xr "commands," commands
.Xr "mail," mail
.Xr "PAGER," pager
.Xr "scat" scat
