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.\" $FreeBSD$ 34.\" 35.Dd April 28, 1995 36.Dt MSGS 1 37.Os 38.Sh NAME 39.Nm msgs 40.Nd system messages and junk mail program 41.Sh SYNOPSIS 42.Nm 43.Op Fl fhlpq 44.Op Ar number 45.Op Ar \-number 46.Nm 47.Op Fl s 48.Nm 49.Op Fl c 50.Op \-days 51.Sh DESCRIPTION 52.Nm Msgs 53is used to read system messages. 54These messages are 55sent by mailing to the login `msgs' and should be short 56pieces of information which are suitable to be read once by most users 57of the system. 58.Pp 59.Nm Msgs 60is normally invoked each time you login, by placing it in the file 61.Pa .login 62(or 63.Pa .profile 64if you use 65.Xr sh 1 ) . 66It will then prompt you with the source and subject of each new message. 67If there is no subject line, the first few non-blank lines of the 68message will be displayed. 69If there is more to the message, you will be told how 70long it is and asked whether you wish to see the rest of the message. 71The possible responses are: 72.Bl -tag -width Fl 73.It Fl y 74Type the rest of the message. 75.It Ic RETURN 76Synonym for y. 77.It Fl n 78Skip this message 79and go on to the next message. 80.It Fl 81Redisplay the last message. 82.It Fl q 83Drop out of 84.Nm ; 85the next time 86.Nm 87will pick up where it last left off. 88.It Fl s 89Append the current message to the file ``Messages'' in the current directory; 90`s\-' will save the previously displayed message. 91A `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. 99Both `m' and `s' accept a numeric argument in place of the `\-'. 100.El 101.Pp 102.Nm Msgs 103keeps track of the next message you will see by a number in the file 104.Pa \&.msgsrc 105in your home directory. 106In the directory 107.Pa /var/msgs 108it keeps a set of files whose names are the (sequential) numbers 109of the messages they represent. 110The file 111.Pa /var/msgs/bounds 112shows the low and high number of the messages in the directory 113so that 114.Nm 115can quickly determine if there are no messages for you. 116If the contents of 117.Pa bounds 118is incorrect it can be fixed by removing it; 119.Nm 120will make a new 121.Pa bounds 122file the next time it is run with the 123.Fl s 124option. 125If 126.Nm 127is run with any option other than 128.Fl s , 129an error will be displayed if 130.Pa /var/msgs/bounds 131does not exist. 132.Pp 133The 134.Fl s 135option is used for setting up the posting of messages. The line 136.Pp 137.Dl msgs: \&"\&| /usr/bin/msgs \-s\&" 138.Pp 139should be included in 140.Pa /etc/mail/aliases 141(see 142.Xr newaliases 1 ) 143to enable posting of messages. 144.Pp 145The 146.Fl c 147option is used for performing cleanup on 148.Pa /var/msgs . 149A shell script entry to run 150.Nm 151with the 152.Fl c 153option should be placed in 154.Pa /etc/periodic/daily 155(see 156.Xr periodic 8 ) 157to run every night. This will remove all messages over 21 days old. 158A different expiration may be specified on the command line to override 159the default. 160.Pp 161Options when reading messages include: 162.Bl -tag -width Fl 163.It Fl f 164Do not say ``No new messages.''. 165This is useful in a 166.Pa .login 167file since this is often the case here. 168.It Fl q 169Queries whether there are messages, printing 170``There are new messages.'' if there are. 171The command ``msgs \-q'' is often used in login scripts. 172.It Fl h 173Print the first part of messages only. 174.It Fl l 175Option causes only locally originated messages to be reported. 176.It Ar num 177A message number can be given 178on the command line, causing 179.Nm 180to start at the specified message rather than at the next message 181indicated by your 182.Pa \&.msgsrc 183file. 184Thus 185.Pp 186.Dl msgs \-h 1 187.Pp 188prints the first part of all messages. 189.It Ar \-number 190Start 191.Ar number 192messages back from the one indicated in the 193.Pa \&.msgsrc 194file, useful for reviews of recent messages. 195.It Fl p 196Pipe long messages through 197.Xr more 1 . 198.El 199.Pp 200Within 201.Nm 202you can also go to any specific message by typing its number when 203.Nm 204requests input as to what to do. 205.Sh ENVIRONMENT 206.Nm Msgs 207uses the 208.Ev HOME 209and 210.Ev TERM 211environment variables for the default home directory and 212terminal type. 213.Sh FILES 214.Bl -tag -width /var/msgs/* -compact 215.It Pa /var/msgs/* 216database 217.It Pa ~/.msgsrc 218number of next message to be presented 219.El 220.Sh SEE ALSO 221.Xr mail 1 , 222.Xr more 1 , 223.Xr aliases 5 , 224.Xr periodic 8 225.Sh HISTORY 226The 227.Nm 228command appeared in 229.Bx 3.0 . 230