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