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