xref: /netbsd/usr.bin/msgs/msgs.1 (revision bf9ec67e)
1.\"	$NetBSD: msgs.1,v 1.12 2001/12/01 20:44:29 wiz Exp $
2.\"
3.\" Copyright (c) 1980, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	@(#)msgs.1	8.2 (Berkeley) 4/28/95
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 fhlpqr
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.Nm
54is used to read system messages.
55These messages are
56sent by mailing to the login `msgs' and should be short
57pieces of information which are suitable to be read once by most users
58of the system.
59.Pp
60.Nm
61is normally invoked each time you login, by placing it in the file
62.Pa .login
63(or
64.Pa .profile
65if you use
66.Xr sh 1 ) .
67It will then prompt you with the source and subject of each new message.
68If there is no subject line, the first few non-blank lines of the
69message will be displayed.
70If there is more to the message, you will be told how
71long it is and asked whether you wish to see the rest of the message.
72The possible responses are:
73.Bl -tag -width Ic
74.It Ic y
75Type the rest of the message.
76.It Ic RETURN
77Synonym for y.
78.It Ic n
79Skip this message
80and go on to the next message.
81.It Ic -
82Redisplay the last message.
83.It Ic q
84Drop out of
85.Nm "" ;
86the next time
87.Nm
88will pick up where it last left off.
89.It Ic s
90Append the current message to the file ``Messages'' in the current directory;
91`s\-' will save the previously displayed message. A `s' or `s\-' may
92be followed by a space and a file name to receive the message replacing
93the default ``Messages''.
94.It Ic m
95A copy of the specified message is placed in a temporary
96mailbox and
97.Xr mail  1
98is invoked on that mailbox.
99.It Ic p
100The specified message is piped through
101.Ev PAGER ,
102or, if
103.Ev PAGER
104is null or not defined,
105.Xr more 1  .
106The commands `m', `p', and `s' all accept a numeric argument in place of the `\-'.
107.El
108.Pp
109.Nm
110keeps track of the next message you will see by a number in the file
111.Pa \&.msgsrc
112in your home directory.
113In the directory
114.Pa /var/msgs
115it keeps a set of files whose names are the (sequential) numbers
116of the messages they represent.
117The file
118.Pa /var/msgs/bounds
119shows the low and high number of the messages in the directory
120so that
121.Nm
122can quickly determine if there are no messages for you.
123If the contents of
124.Pa bounds
125is incorrect it can be fixed by removing it;
126.Nm
127will make a new
128.Pa bounds
129file the next time it is run.
130.Pp
131The
132.Fl s
133option is used for setting up the posting of messages.  The line
134.Pp
135.Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
136.Pp
137should be included in
138.Pa /etc/mail/aliases
139(see
140.Xr newaliases 1 )
141to enable posting of messages.
142.Pp
143The
144.Fl c
145option is used for performing cleanup on
146.Pa /var/msgs .
147An entry with the
148.Fl c
149option should be placed in
150.Pa /etc/crontab
151to run every night.  This will remove all messages over 21 days old.
152A different expiration may be specified on the command line to override
153the default.
154.Pp
155Options when reading messages include:
156.Bl -tag -width Fl
157.It Fl f
158Do not to say ``No new messages.''.
159This is useful in a
160.Pa .login
161file since this is often the case here.
162.It Fl q
163Queries whether there are messages, printing
164``There are new messages.'' if there are.
165The command ``msgs \-q'' is often used in login scripts.
166.It Fl h
167Print the first part of messages only.
168.It Fl r
169Disables the ability to save messages or enter the mailer.  It is
170assumed that
171.Ev PAGER
172is set to something secure.
173.It Fl l
174Option causes only locally originated messages to be reported.
175.It Ar num
176A message number can be given
177on the command line, causing
178.Nm
179to start at the specified message rather than at the next message
180indicated by your
181.Pa \&.msgsrc
182file.
183Thus
184.Pp
185.Dl msgs \-h 1
186.Pp
187prints the first part of all messages.
188.It Ar \-number
189Start
190.Ar number
191messages back from the one indicated in the
192.Pa \&.msgsrc
193file, useful for reviews of recent messages.
194.It Fl p
195Pipe long messages through
196.Ev PAGER ,
197or, if
198.Ev PAGER
199is null or not defined,
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
209.Nm
210uses the
211.Ev HOME
212and
213.Ev TERM
214environment variables for the default home directory and
215terminal type.
216.Sh FILES
217.Bl -tag -width /var/msgs/* -compact
218.It Pa /var/msgs/*
219database
220.It ~/.msgsrc
221number of next message to be presented
222.El
223.Sh SEE ALSO
224.Xr mail 1 ,
225.Xr more 1 ,
226.Xr aliases 5
227.\".Xr crontab 5
228.Sh HISTORY
229The
230.Nm
231command appeared in
232.Bx 3.0 .
233