msgs(1) — Unsupported
Name
msgs − system messages and junk mail program
Syntax
msgs [ −fhlpq ] [ number ] [ −number ]
msgs -s
msgs -c [ −days ]
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 that 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 it in the file .login (.profile if you use /bin/sh). 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.
s append the current message to the file Messages in the current directory; s− saves the previously displayed message. Entering s or s− followed by a space and a filename specifies writing the message to a file other than 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 you run msgs.
Options to msgs include:
−f which 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 option causes only locally originated messages to be reported.
num causes msgs to start at the message specified by num, rather than at the next message indicated by your .msgsrc file. Thus
% msgs 5
causes msgs to begin at the fifth message.
−number causes msgs to start number messages back from the one indicated by your .msgsrc file. This option is useful for reviewing recent messages.
−p causes long messages to be piped through more.
−s adds a new message to /usr/msgs.
−c removes messages that have been in /usr/msgs more than a specified number of days from that file. The -days option determines the number of days a message is in /usr/msgs before it is removed. You must be the superuser to use the -c option.
Within msgs you can also go to any specific message by typing its number when msgs requests input.
Files
/usr/msgs/*database
~/.msgsrcnumber of next message to be presented