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