xref: /freebsd/usr.bin/msgs/msgs.1 (revision ee2ea5ceafed78a5bd9810beb9e3ca927180c226)
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 Ns ;
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.  The line
139.Pp
140.Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
141.Pp
142should be included in
143.Pa /etc/mail/aliases
144(see
145.Xr newaliases 1 )
146to enable posting of messages.
147.Pp
148The
149.Fl c
150option is used for performing cleanup on
151.Pa /var/msgs .
152A shell script entry to run
153.Nm
154with the
155.Fl c
156option should be placed in
157.Pa /etc/periodic/daily
158(see
159.Xr periodic 8 )
160to run every night.  This will remove all messages over 21 days old.
161A different expiration may be specified on the command line to override
162the default.  You 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