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.2 (Berkeley) 4/28/95 33.\" 34.Dd April 28, 1995 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 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 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 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 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/bin/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 . 138A shell script entry to run 139.Nm 140with the 141.Fl c 142option should be placed in 143.Pa /etc/periodic/daily 144(see 145.Xr periodic 8 ) 146to run every night. This will remove all messages over 21 days old. 147A different expiration may be specified on the command line to override 148the default. 149.Pp 150Options when reading messages include: 151.Bl -tag -width Fl 152.It Fl f 153Do not say ``No new messages.''. 154This is useful in a 155.Pa .login 156file since this is often the case here. 157.It Fl q 158Queries whether there are messages, printing 159``There are new messages.'' if there are. 160The command ``msgs \-q'' is often used in login scripts. 161.It Fl h 162Print the first part of messages only. 163.It Fl l 164Option causes only locally originated messages to be reported. 165.It Ar num 166A message number can be given 167on the command line, causing 168.Nm 169to start at the specified message rather than at the next message 170indicated by your 171.Pa \&.msgsrc 172file. 173Thus 174.Pp 175.Dl msgs \-h 1 176.Pp 177prints the first part of all messages. 178.It Ar \-number 179Start 180.Ar number 181messages back from the one indicated in the 182.Pa \&.msgsrc 183file, useful for reviews of recent messages. 184.It Fl p 185Pipe long messages through 186.Xr more 1 . 187.El 188.Pp 189Within 190.Nm 191you can also go to any specific message by typing its number when 192.Nm 193requests input as to what to do. 194.Sh ENVIRONMENT 195.Nm Msgs 196uses the 197.Ev HOME 198and 199.Ev TERM 200environment variables for the default home directory and 201terminal type. 202.Sh FILES 203.Bl -tag -width /var/msgs/* -compact 204.It Pa /var/msgs/* 205database 206.It ~/.msgsrc 207number of next message to be presented 208.El 209.Sh SEE ALSO 210.Xr mail 1 , 211.Xr more 1 , 212.Xr aliases 5 , 213.Xr periodic 8 214.Sh HISTORY 215The 216.Nm 217command appeared in 218.Bx 3.0 . 219