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