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