1.\" Copyright (c) 1980, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)msgs.1 6.6 (Berkeley) 07/24/90 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.Pp 20.Nm msgs 21.Op Fl s 22.Pp 23.Nm msgs 24.Op Fl c 25.Op \-days 26.Sh DESCRIPTION 27.Nm Msgs 28is used to read system messages. 29These messages are 30sent by mailing to the login `msgs' and should be short 31pieces of information which are suitable to be read once by most users 32of the system. 33.Pp 34.Nm Msgs 35is normally invoked each time you login, by placing it in the file 36.Pa \& .login 37(or 38.Pa \&.profile 39if you use 40.Xr sh 1 ) . 41It will then prompt you with the source and subject of each new message. 42If there is no subject line, the first few non-blank lines of the 43message will be displayed. 44If there is more to the message, you will be told how 45long it is and asked whether you wish to see the rest of the message. 46The possible responses are: 47.Tw Fl 48.Tp Fl y 49type the rest of the message. 50.Tp Ic RETURN 51synonym for y. 52.Tp Fl n 53skip this message 54and go on to the next message. 55.Tp Fl 56redisplay the last message. 57.Tp Fl q 58drops you out of 59.Nm msgs ; 60the next time you run the program it will pick up where you left off. 61.Tp 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.Tp Fl m 67or `m\-' causes a copy of the specified message to be placed in a temporary 68mailbox and 69.Xr mail 1 70to be invoked on that mailbox. 71Both `m' and `s' accept a numeric argument in place of the `\-'. 72.Tp 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/ucb/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.Tw Fl 122.Tp Fl f 123which causes it not to say ``No new messages.''. 124This is useful in your 125.Pa \& .login 126file since this is often the case here. 127.Tp 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.Tp Fl h 132causes 133.Nm msgs 134to print the first part of messages only. 135.Tp Fl l 136option causes only locally originated messages to be reported. 137.Tp Ar num 138A message number can be given 139on the command line, causing 140.Nm msgs 141to start at the specified message rather than at the next message 142indicated by your 143.Pa \&.msgsrc 144file. 145Thus 146.Pp 147.Dl msgs \-h 1 148.Pp 149prints the first part of all messages. 150.Tp Ar \-number 151will cause 152.Nm msgs 153to start 154.Ar number 155messages back from the one indicated by your 156.Pa \&.msgsrc 157file, useful for reviews of recent messages. 158.Tp Fl p 159causes long messages to be piped through 160.Xr more 1 . 161.Tp 162.Pp 163Within 164.Nm msgs 165you can also go to any specific message by typing its number when 166.Nm msgs 167requests input as to what to do. 168.Sh ENVIRONMENT 169.Nm Msgs 170uses the 171.Ev HOME 172and 173.Ev TERM 174environment variables for the default home directory and 175terminal type. 176.Sh FILES 177.Dw /usr/msgs/* 178.Di L 179.Dp Pa /usr/msgs/* 180database 181.Dp ~/.msgsrc 182number of next message to be presented 183.Dp 184.Sh AUTHORS 185William Joy 186.br 187David Wasley 188.Sh SEE ALSO 189.Xr aliases 5 , 190.\".Xr crontab 5 , 191.Xr mail 1 , 192.Xr more 1 193.Sh HISTORY 194.Nm Msgs 195appeared in 3 BSD. 196.Sh BUGS 197