1.\" Copyright (c) 1980, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)msgs.1 8.1 (Berkeley) 6/6/93 33.\" 34.Dd June 6, 1993 35.Dt MSGS 1 36.Os BSD 4 37.Sh NAME 38.Nm msgs 39.Nd system messages and junk mail program 40.Sh SYNOPSIS 41.Nm msgs 42.Op Fl fhlpq 43.Op Ar number 44.Op Ar \-number 45.Nm msgs 46.Op Fl s 47.Nm msgs 48.Op Fl c 49.Op \-days 50.Sh DESCRIPTION 51.Nm Msgs 52is used to read system messages. 53These messages are 54sent by mailing to the login `msgs' and should be short 55pieces of information which are suitable to be read once by most users 56of the system. 57.Pp 58.Nm Msgs 59is normally invoked each time you login, by placing it in the file 60.Pa .login 61(or 62.Pa .profile 63if you use 64.Xr sh 1 ) . 65It will then prompt you with the source and subject of each new message. 66If there is no subject line, the first few non-blank lines of the 67message will be displayed. 68If there is more to the message, you will be told how 69long it is and asked whether you wish to see the rest of the message. 70The possible responses are: 71.Bl -tag -width Fl 72.It Fl y 73Type the rest of the message. 74.It Ic RETURN 75Synonym for y. 76.It Fl n 77Skip this message 78and go on to the next message. 79.It Fl 80Redisplay the last message. 81.It Fl q 82Drop out of 83.Nm msgs ; 84the next time 85.Nm msgs 86will pick up where it last left off. 87.It Fl s 88Append the current message to the file ``Messages'' in the current directory; 89`s\-' will save the previously displayed message. A `s' or `s\-' may 90be followed by a space and a file name to receive the message replacing 91the default ``Messages''. 92.It Fl m 93A copy of the specified message is placed in a temporary 94mailbox and 95.Xr mail 1 96is invoked on that mailbox. 97Both `m' and `s' accept a numeric argument in place of the `\-'. 98.El 99.Pp 100.Nm Msgs 101keeps track of the next message you will see by a number in the file 102.Pa \&.msgsrc 103in your home directory. 104In the directory 105.Pa /var/msgs 106it keeps a set of files whose names are the (sequential) numbers 107of the messages they represent. 108The file 109.Pa /var/msgs/bounds 110shows the low and high number of the messages in the directory 111so that 112.Nm msgs 113can quickly determine if there are no messages for you. 114If the contents of 115.Pa bounds 116is incorrect it can be fixed by removing it; 117.Nm msgs 118will make a new 119.Pa bounds 120file the next time it is run. 121.Pp 122The 123.Fl s 124option is used for setting up the posting of messages. The line 125.Pp 126.Dl msgs: \&"\&| /usr/ucb/msgs \-s\&" 127.Pp 128should be included in 129.Pa /etc/aliases 130(see 131.Xr newaliases 1 ) 132to enable posting of messages. 133.Pp 134The 135.Fl c 136option is used for performing cleanup on 137.Pa /var/msgs. 138An entry with the 139.Fl c 140option should be placed in 141.Pa /etc/crontab 142to run every night. This will remove all messages over 21 days old. 143A different expiration may be specified on the command line to override 144the default. 145.Pp 146Options when reading messages include: 147.Bl -tag -width Fl 148.It Fl f 149Do not to say ``No new messages.''. 150This is useful in a 151.Pa .login 152file since this is often the case here. 153.It Fl q 154Queries whether there are messages, printing 155``There are new messages.'' if there are. 156The command ``msgs \-q'' is often used in login scripts. 157.It Fl h 158Print the first part of messages only. 159.It Fl l 160Option causes only locally originated messages to be reported. 161.It Ar num 162A message number can be given 163on the command line, causing 164.Nm msgs 165to start at the specified message rather than at the next message 166indicated by your 167.Pa \&.msgsrc 168file. 169Thus 170.Pp 171.Dl msgs \-h 1 172.Pp 173prints the first part of all messages. 174.It Ar \-number 175Start 176.Ar number 177messages back from the one indicated in the 178.Pa \&.msgsrc 179file, useful for reviews of recent messages. 180.It Fl p 181Pipe long messages through 182.Xr more 1 . 183.El 184.Pp 185Within 186.Nm msgs 187you can also go to any specific message by typing its number when 188.Nm msgs 189requests input as to what to do. 190.Sh ENVIRONMENT 191.Nm Msgs 192uses the 193.Ev HOME 194and 195.Ev TERM 196environment variables for the default home directory and 197terminal type. 198.Sh FILES 199.Bl -tag -width /usr/msgs/* -compact 200.It Pa /usr/msgs/* 201database 202.It ~/.msgsrc 203number of next message to be presented 204.El 205.Sh SEE ALSO 206.Xr aliases 5 , 207.\".Xr crontab 5 , 208.Xr mail 1 , 209.Xr more 1 210.Sh HISTORY 211The 212.Nm msgs 213command appeared in 214.Bx 3.0 . 215