xref: /freebsd/usr.bin/msgs/msgs.1 (revision 4cf49a43559ed9fdad601bdcccd2c55963008675)
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 BSD 4
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 msgs
47.Op Fl s
48.Nm msgs
49.Op Fl c
50.Op \-days
51.Sh DESCRIPTION
52.Nm Msgs
53is used to read system messages.
54These messages are
55sent by mailing to the login `msgs' and should be short
56pieces of information which are suitable to be read once by most users
57of the system.
58.Pp
59.Nm Msgs
60is normally invoked each time you login, by placing it in the file
61.Pa .login
62(or
63.Pa .profile
64if you use
65.Xr sh 1 ) .
66It will then prompt you with the source and subject of each new message.
67If there is no subject line, the first few non-blank lines of the
68message will be displayed.
69If there is more to the message, you will be told how
70long it is and asked whether you wish to see the rest of the message.
71The possible responses are:
72.Bl -tag -width Fl
73.It Fl y
74Type the rest of the message.
75.It Ic RETURN
76Synonym for y.
77.It Fl n
78Skip this message
79and go on to the next message.
80.It Fl
81Redisplay the last message.
82.It Fl q
83Drop out of
84.Nm msgs ;
85the next time
86.Nm
87will pick up where it last left off.
88.It Fl s
89Append the current message to the file ``Messages'' in the current directory;
90`s\-' will save the previously displayed message. A `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
101.Nm Msgs
102keeps track of the next message you will see by a number in the file
103.Pa \&.msgsrc
104in your home directory.
105In the directory
106.Pa /var/msgs
107it keeps a set of files whose names are the (sequential) numbers
108of the messages they represent.
109The file
110.Pa /var/msgs/bounds
111shows the low and high number of the messages in the directory
112so that
113.Nm
114can quickly determine if there are no messages for you.
115If the contents of
116.Pa bounds
117is incorrect it can be fixed by removing it;
118.Nm
119will make a new
120.Pa bounds
121file the next time it is run with the
122.Fl s
123option.
124If
125.Nm
126is run with any option other than
127.Fl s ,
128an error will be displayed if
129.Pa /var/msgs/bounds
130does not exist.
131.Pp
132The
133.Fl s
134option is used for setting up the posting of messages.  The line
135.Pp
136.Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
137.Pp
138should be included in
139.Pa /etc/aliases
140(see
141.Xr newaliases 1 )
142to enable posting of messages.
143.Pp
144The
145.Fl c
146option is used for performing cleanup on
147.Pa /var/msgs .
148A shell script entry to run
149.Nm
150with the
151.Fl c
152option should be placed in
153.Pa /etc/periodic/daily
154(see
155.Xr periodic 8 )
156to run every night.  This will remove all messages over 21 days old.
157A different expiration may be specified on the command line to override
158the default.
159.Pp
160Options when reading messages include:
161.Bl -tag -width Fl
162.It Fl f
163Do not say ``No new messages.''.
164This is useful in a
165.Pa .login
166file since this is often the case here.
167.It Fl q
168Queries whether there are messages, printing
169``There are new messages.'' if there are.
170The command ``msgs \-q'' is often used in login scripts.
171.It Fl h
172Print the first part of messages only.
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.Xr more  1  .
197.El
198.Pp
199Within
200.Nm
201you can also go to any specific message by typing its number when
202.Nm
203requests input as to what to do.
204.Sh ENVIRONMENT
205.Nm Msgs
206uses the
207.Ev HOME
208and
209.Ev TERM
210environment variables for the default home directory and
211terminal type.
212.Sh FILES
213.Bl -tag -width /var/msgs/* -compact
214.It Pa /var/msgs/*
215database
216.It ~/.msgsrc
217number of next message to be presented
218.El
219.Sh SEE ALSO
220.Xr mail 1 ,
221.Xr more 1 ,
222.Xr aliases 5 ,
223.Xr periodic 8
224.Sh HISTORY
225The
226.Nm
227command appeared in
228.Bx 3.0 .
229