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