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