MSGS(1,C) AIX Commands Reference MSGS(1,C)
-------------------------------------------------------------------------------
msgs
PURPOSE
Reads system messages.
SYNTAX
+----------------+
msgs ---| +------------+ |---|
+-| -f |-+
^| -h ||
|| -l ||
|| -p ||
|| -q ||
|| num ||
|| -number ||
|+------------+|
+--------------+
Warning: See restrictions, Chapter 18, AIX Programming Tools and Interfaces.
DESCRIPTION
The msgs command is used to read system messages. These messages are sent by
mailing to the login msgs and should be short pieces of information which are
suitable to be read once by most users of the system.
The msgs command is normally invoked each time you log in, by placing the
command in the file .profile if you use /bin/sh (.login if you use /bin/csh).
It will then prompt you with the source and subject of each new message. If
there is no subject line, the first few non-blank lines of the message will be
displayed. If there is more to the message, you will be told how long it is
and asked whether you wish to see the rest of the message. The possible
responses are:
y Type the rest of the message.
RETURN Synonym for y.
n Skip this message and go on to the next message.
- Redisplay the last message.
q Drops you out of msgs; the next time you run the program it will
pick up where you left off.
Processed November 8, 1990 MSGS(1,C) 1
MSGS(1,C) AIX Commands Reference MSGS(1,C)
s Append the current message to the file Messages in the current
directory; s- will save the previously displayed message. An s
or s- followed by a space and a file name specifies the file to
receive the message (instead of the default "Messages").
m Or m- causes a copy of the specified message to be placed in a
temporary mailbox and mail to be invoked on that mailbox. Both
m and s accept a numeric argument in place of the '-'.
The msgs command keeps track of the next message you will see by a number in
the file .msgsrc in your home directory. In the directory /usr/msgs it keeps a
set of files whose names are the (sequential) numbers of the messages they
represent. The file /usr/msgs/bounds shows the low and high number of the
messages in the directory so that msgs can quickly determine if there are no
messages for you. If the contents of bounds is incorrect it can be fixed by
removing it; msgs will make a new bounds file the next time it is run.
The -s option is used for setting up the posting of messages. The line
msgs: "| /usr/ucb/msgs -s"
should be included in /usr/adm/sendmail/aliases by the system administrator and
the command /usr/lib/newaliases should be run.
The -c option is used for performing cleanup on /usr/msgs. An entry with the
-c option should be placed in /usr/spool/cron/crontabs to run every night.
This will remove all messages over 21 days old. A different expiration may be
specified on the command line to override the default.
FLAGS
Options when reading messages include:
-f Causes it not to say "No new messages.." This is useful in your .login
file since this is often the case here.
-q Queries whether there are messages, printing "There are new messages." if
there are. The command "msgs -q" is often used in login scripts.
-h Causes msgs to print the first part of messages only.
-l Causes only locally originated messages to be reported.
num Causes msgs to start at the specified message num, rather than at the next
message indicated by your .msgsrc file. Thus
msgs -h 1
prints the first part of all messages.
Processed November 8, 1990 MSGS(1,C) 2
MSGS(1,C) AIX Commands Reference MSGS(1,C)
-number
Causes msgs to start number messages back from the one indicated by your
.msgsrc file, useful for reviews of recent messages.
-p Causes long messages to be piped through more.
Within the msgs command you can also go to any specific message by typing its
number when msgs requests input as to what to do.
FILES
/usr/msgs/* Data base.
~/.msgsrc Number of next message to be presented.
RELATED INFORMATION
See the following commands: "crontab," "mail, Mail," and "more, page."
Processed November 8, 1990 MSGS(1,C) 3