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