1.\" Copyright (c) 1980, 1990, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)msgs.1 8.2 (Berkeley) 04/28/95 7.\" 8.Dd 9.Dt MSGS 1 10.Os BSD 4 11.Sh NAME 12.Nm msgs 13.Nd system messages and junk mail program 14.Sh SYNOPSIS 15.Nm msgs 16.Op Fl fhlpq 17.Op Ar number 18.Op Ar \-number 19.Nm msgs 20.Op Fl s 21.Nm msgs 22.Op Fl c 23.Op \-days 24.Sh DESCRIPTION 25.Nm Msgs 26is used to read system messages. 27These messages are 28sent by mailing to the login `msgs' and should be short 29pieces of information which are suitable to be read once by most users 30of the system. 31.Pp 32.Nm Msgs 33is normally invoked each time you login, by placing it in the file 34.Pa .login 35(or 36.Pa .profile 37if you use 38.Xr sh 1 ) . 39It will then prompt you with the source and subject of each new message. 40If there is no subject line, the first few non-blank lines of the 41message will be displayed. 42If there is more to the message, you will be told how 43long it is and asked whether you wish to see the rest of the message. 44The possible responses are: 45.Bl -tag -width Fl 46.It Fl y 47Type the rest of the message. 48.It Ic RETURN 49Synonym for y. 50.It Fl n 51Skip this message 52and go on to the next message. 53.It Fl 54Redisplay the last message. 55.It Fl q 56Drop out of 57.Nm msgs ; 58the next time 59.Nm msgs 60will pick up where it last left off. 61.It Fl s 62Append the current message to the file ``Messages'' in the current directory; 63`s\-' will save the previously displayed message. A `s' or `s\-' may 64be followed by a space and a file name to receive the message replacing 65the default ``Messages''. 66.It Fl m 67A copy of the specified message is placed in a temporary 68mailbox and 69.Xr mail 1 70is invoked on that mailbox. 71Both `m' and `s' accept a numeric argument in place of the `\-'. 72.El 73.Pp 74.Nm Msgs 75keeps track of the next message you will see by a number in the file 76.Pa \&.msgsrc 77in your home directory. 78In the directory 79.Pa /var/msgs 80it keeps a set of files whose names are the (sequential) numbers 81of the messages they represent. 82The file 83.Pa /var/msgs/bounds 84shows the low and high number of the messages in the directory 85so that 86.Nm msgs 87can quickly determine if there are no messages for you. 88If the contents of 89.Pa bounds 90is incorrect it can be fixed by removing it; 91.Nm msgs 92will make a new 93.Pa bounds 94file the next time it is run. 95.Pp 96The 97.Fl s 98option is used for setting up the posting of messages. The line 99.Pp 100.Dl msgs: \&"\&| /usr/bin/msgs \-s\&" 101.Pp 102should be included in 103.Pa /etc/aliases 104(see 105.Xr newaliases 1 ) 106to enable posting of messages. 107.Pp 108The 109.Fl c 110option is used for performing cleanup on 111.Pa /var/msgs. 112An entry with the 113.Fl c 114option should be placed in 115.Pa /etc/crontab 116to run every night. This will remove all messages over 21 days old. 117A different expiration may be specified on the command line to override 118the default. 119.Pp 120Options when reading messages include: 121.Bl -tag -width Fl 122.It Fl f 123Do not to say ``No new messages.''. 124This is useful in a 125.Pa .login 126file since this is often the case here. 127.It Fl q 128Queries whether there are messages, printing 129``There are new messages.'' if there are. 130The command ``msgs \-q'' is often used in login scripts. 131.It Fl h 132Print the first part of messages only. 133.It Fl l 134Option causes only locally originated messages to be reported. 135.It Ar num 136A message number can be given 137on the command line, causing 138.Nm msgs 139to start at the specified message rather than at the next message 140indicated by your 141.Pa \&.msgsrc 142file. 143Thus 144.Pp 145.Dl msgs \-h 1 146.Pp 147prints the first part of all messages. 148.It Ar \-number 149Start 150.Ar number 151messages back from the one indicated in the 152.Pa \&.msgsrc 153file, useful for reviews of recent messages. 154.It Fl p 155Pipe long messages through 156.Xr more 1 . 157.El 158.Pp 159Within 160.Nm msgs 161you can also go to any specific message by typing its number when 162.Nm msgs 163requests input as to what to do. 164.Sh ENVIRONMENT 165.Nm Msgs 166uses the 167.Ev HOME 168and 169.Ev TERM 170environment variables for the default home directory and 171terminal type. 172.Sh FILES 173.Bl -tag -width /usr/msgs/* -compact 174.It Pa /usr/msgs/* 175database 176.It ~/.msgsrc 177number of next message to be presented 178.El 179.Sh SEE ALSO 180.Xr aliases 5 , 181.\".Xr crontab 5 , 182.Xr mail 1 , 183.Xr more 1 184.Sh HISTORY 185The 186.Nm msgs 187command appeared in 188.Bx 3.0 . 189