xref: /dragonfly/usr.bin/msgs/msgs.1 (revision 0db87cb7)
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. Neither the name of the University nor the names of its contributors
13.\"    may be used to endorse or promote products derived from this software
14.\"    without specific prior written permission.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26.\" SUCH DAMAGE.
27.\"
28.\"	@(#)msgs.1	8.2 (Berkeley) 4/28/95
29.\" $FreeBSD: src/usr.bin/msgs/msgs.1,v 1.9.2.7 2002/07/15 07:19:24 keramida Exp $
30.\" $DragonFly: src/usr.bin/msgs/msgs.1,v 1.2 2003/06/17 04:29:29 dillon Exp $
31.\"
32.Dd April 28, 1995
33.Dt MSGS 1
34.Os
35.Sh NAME
36.Nm msgs
37.Nd system messages and junk mail program
38.Sh SYNOPSIS
39.Nm
40.Op Fl fhlpq
41.Op Ar number
42.Op Ar \-number
43.Nm
44.Op Fl s
45.Nm
46.Op Fl c
47.Op \-days
48.Sh DESCRIPTION
49The
50.Nm
51utility is used to read system messages.
52These messages are
53sent by mailing to the login `msgs' and should be short
54pieces of information which are suitable to be read once by most users
55of the system.
56.Pp
57The
58.Nm
59utility is normally invoked each time you login, by placing it in the file
60.Pa .login
61(or
62.Pa .profile
63if you use
64.Xr sh 1 ) .
65It will then prompt you with the source and subject of each new message.
66If there is no subject line, the first few non-blank lines of the
67message will be displayed.
68If there is more to the message, you will be told how
69long it is and asked whether you wish to see the rest of the message.
70The possible responses are:
71.Bl -tag -width Fl
72.It Fl y
73Type the rest of the message.
74.It Ic RETURN
75Synonym for y.
76.It Fl n
77Skip this message
78and go on to the next message.
79.It Fl
80Redisplay the last message.
81.It Fl q
82Drop out of
83.Nm ;
84the next time
85.Nm
86will pick up where it last left off.
87.It Fl s
88Append the current message to the file ``Messages'' in the current directory;
89`s\-' will save the previously displayed message.
90A `s' or `s\-' may
91be followed by a space and a file name to receive the message replacing
92the default ``Messages''.
93.It Fl m
94A copy of the specified message is placed in a temporary
95mailbox and
96.Xr mail  1
97is invoked on that mailbox.
98Both `m' and `s' accept a numeric argument in place of the `\-'.
99.El
100.Pp
101The
102.Nm
103utility keeps track of the next message you will see by a number in the file
104.Pa \&.msgsrc
105in your home directory.
106In the directory
107.Pa /var/msgs
108it keeps a set of files whose names are the (sequential) numbers
109of the messages they represent.
110The file
111.Pa /var/msgs/bounds
112shows the low and high number of the messages in the directory
113so that
114.Nm
115can quickly determine if there are no messages for you.
116If the contents of
117.Pa bounds
118is incorrect it can be fixed by removing it;
119.Nm
120will make a new
121.Pa bounds
122file the next time it is run with the
123.Fl s
124option.
125If
126.Nm
127is run with any option other than
128.Fl s ,
129an error will be displayed if
130.Pa /var/msgs/bounds
131does not exist.
132.Pp
133The
134.Fl s
135option is used for setting up the posting of messages.
136The line
137.Pp
138.Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
139.Pp
140should be included in
141.Pa /etc/mail/aliases
142(see
143.Xr newaliases 1 )
144to enable posting of messages.
145.Pp
146The
147.Fl c
148option is used for performing cleanup on
149.Pa /var/msgs .
150A shell script entry to run
151.Nm
152with the
153.Fl c
154option should be placed in
155.Pa /etc/periodic/daily
156(see
157.Xr periodic 8 )
158to run every night.
159This will remove all messages over 21 days old.
160A different expiration may be specified on the command line to override
161the default.
162You must be the superuser to use this option.
163.Pp
164Options when reading messages include:
165.Bl -tag -width Fl
166.It Fl f
167Do not say ``No new messages.''.
168This is useful in a
169.Pa .login
170file since this is often the case here.
171.It Fl q
172Queries whether there are messages, printing
173``There are new messages.'' if there are.
174The command ``msgs \-q'' is often used in login scripts.
175.It Fl h
176Print the first part of messages only.
177.It Fl l
178Cause only locally originated messages to be reported.
179.It Ar num
180A message number can be given
181on the command line, causing
182.Nm
183to start at the specified message rather than at the next message
184indicated by your
185.Pa \&.msgsrc
186file.
187Thus
188.Pp
189.Dl msgs \-h 1
190.Pp
191prints the first part of all messages.
192.It Ar \-number
193Start
194.Ar number
195messages back from the one indicated in the
196.Pa \&.msgsrc
197file, useful for reviews of recent messages.
198.It Fl p
199Pipe long messages through
200.Xr more  1  .
201.El
202.Pp
203Within
204.Nm
205you can also go to any specific message by typing its number when
206.Nm
207requests input as to what to do.
208.Sh ENVIRONMENT
209The
210.Nm
211utility uses the
212.Ev HOME
213and
214.Ev TERM
215environment variables for the default home directory and
216terminal type.
217.Sh FILES
218.Bl -tag -width /var/msgs/* -compact
219.It Pa /var/msgs/*
220database
221.It Pa ~/.msgsrc
222number of next message to be presented
223.El
224.Sh SEE ALSO
225.Xr mail 1 ,
226.Xr more 1 ,
227.Xr aliases 5 ,
228.Xr periodic 8
229.Sh HISTORY
230The
231.Nm
232command appeared in
233.Bx 3.0 .
234