Annotation of src/usr.bin/msgs/msgs.1, Revision 1.9
1.9 ! aaron 1: .\" $OpenBSD: msgs.1,v 1.8 2000/03/05 00:28:58 aaron 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
1.6 aaron 39: .Os
1.1 deraadt 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
1.8 aaron 57: sent by mailing to the login
58: .Dq msgs
59: and should be short
1.1 deraadt 60: pieces of information which are suitable to be read once by most users
61: of the system.
62: .Pp
1.8 aaron 63: The options are as follows:
1.5 aaron 64: .Bl -tag -width Fl
65: .It Fl f
1.8 aaron 66: Do not say
67: .Dq \&No new messages.
1.5 aaron 68: This is useful in a
69: .Pa .login
70: file since this is often the case here.
71: .It Fl q
72: Queries whether there are messages, printing
1.8 aaron 73: .Dq There are new messages.
74: if there are.
75: The command
76: .Ic msgs \-q
77: is often used in login scripts.
1.5 aaron 78: .It Fl h
79: Print the first part of messages only.
80: .It Fl r
1.9 ! aaron 81: Disables the ability to save messages or enter the mailer.
! 82: It is assumed that the
1.5 aaron 83: .Ev PAGER
84: environment is set to something secure.
85: .It Fl l
86: Causes only locally originated messages to be reported.
87: .It Ar num
88: A message number can be given
89: on the command line, causing
90: .Nm msgs
91: to start at the specified message rather than at the next message
92: indicated by your
93: .Pa \&.msgsrc
94: file.
95: Thus
96: .Pp
97: .Dl msgs \-h 1
98: .Pp
99: prints the first part of all messages.
100: .It Ar \-number
101: Start
102: .Ar number
103: messages back from the one indicated in the
104: .Pa \&.msgsrc
105: file, useful for reviews of recent messages.
106: .It Fl p
107: Pipe long messages through the program specified by the
108: .Ev PAGER
1.9 ! aaron 109: environment variable.
! 110: If
1.5 aaron 111: .Ev PAGER
1.7 pjanzen 112: is null or not defined,
1.5 aaron 113: .Xr more 1
114: is used.
115: .El
116: .Pp
1.3 aaron 117: .Nm msgs
1.1 deraadt 118: is normally invoked each time you login, by placing it in the file
119: .Pa .login
120: (or
121: .Pa .profile
122: if you use
123: .Xr sh 1 ) .
124: It will then prompt you with the source and subject of each new message.
125: If there is no subject line, the first few non-blank lines of the
126: message will be displayed.
127: If there is more to the message, you will be told how
128: long it is and asked whether you wish to see the rest of the message.
129: The possible responses are:
130: .Bl -tag -width Fl
1.3 aaron 131: .It Ic y
1.1 deraadt 132: Type the rest of the message.
133: .It Ic RETURN
1.3 aaron 134: Synonym for
135: .Ic y .
136: .It Ic n
1.1 deraadt 137: Skip this message
138: and go on to the next message.
1.3 aaron 139: .It Ic \&-
1.1 deraadt 140: Redisplay the last message.
1.3 aaron 141: .It Ic q
1.1 deraadt 142: Drop out of
143: .Nm msgs ;
144: the next time
145: .Nm msgs
146: will pick up where it last left off.
1.3 aaron 147: .It Ic s
1.8 aaron 148: Append the current message to the file
149: .Pa Messages
150: in the current directory;
1.9 ! aaron 151: .Sq s\-
! 152: will save the previously displayed message.
! 153: An
! 154: .Sq s
! 155: or
! 156: .Sq s\-
! 157: may be followed by a space and a file name to receive the message replacing
! 158: the default
! 159: .Dq Messages .
1.3 aaron 160: .It Ic m
1.1 deraadt 161: A copy of the specified message is placed in a temporary
162: mailbox and
1.8 aaron 163: .Xr mail 1
1.1 deraadt 164: is invoked on that mailbox.
1.3 aaron 165: .It Ic p
1.5 aaron 166: The specified message is piped through the program specified by the
167: .Ev PAGER
1.9 ! aaron 168: environment variable.
! 169: If
1.5 aaron 170: .Ev PAGER
171: is not defined,
172: .Xr more 1
173: is used.
1.1 deraadt 174: .El
175: .Pp
1.9 ! aaron 176: The commands
! 177: .Ic m ,
! 178: .Ic p ,
! 179: and
! 180: .Ic s
! 181: all accept a numeric argument in place of the
1.5 aaron 182: .Sq \&- .
183: .Pp
1.3 aaron 184: .Nm msgs
1.1 deraadt 185: keeps track of the next message you will see by a number in the file
186: .Pa \&.msgsrc
187: in your home directory.
188: In the directory
189: .Pa /var/msgs
190: it keeps a set of files whose names are the (sequential) numbers
191: of the messages they represent.
192: The file
193: .Pa /var/msgs/bounds
194: shows the low and high number of the messages in the directory
195: so that
196: .Nm msgs
197: can quickly determine if there are no messages for you.
198: If the contents of
199: .Pa bounds
200: is incorrect it can be fixed by removing it;
201: .Nm msgs
202: will make a new
203: .Pa bounds
204: file the next time it is run.
205: .Pp
206: The
207: .Fl s
1.9 ! aaron 208: option is used for setting up the posting of messages.
! 209: The line
1.1 deraadt 210: .Pp
211: .Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
212: .Pp
213: should be included in
214: .Pa /etc/aliases
215: (see
216: .Xr newaliases 1 )
217: to enable posting of messages.
218: .Pp
219: The
220: .Fl c
221: option is used for performing cleanup on
1.3 aaron 222: .Pa /var/msgs .
1.1 deraadt 223: An entry with the
224: .Fl c
225: option should be placed in
226: .Pa /etc/crontab
1.9 ! aaron 227: to run every night.
! 228: This will remove all messages over 21 days old.
1.1 deraadt 229: A different expiration may be specified on the command line to override
230: the default.
231: .Pp
232: Within
233: .Nm msgs
234: you can also go to any specific message by typing its number when
235: .Nm msgs
236: requests input as to what to do.
237: .Sh ENVIRONMENT
1.3 aaron 238: .Nm msgs
1.1 deraadt 239: uses the
240: .Ev HOME
241: and
242: .Ev TERM
243: environment variables for the default home directory and
1.9 ! aaron 244: terminal type.
! 245: If defined and non-null, the
1.5 aaron 246: .Ev PAGER
247: variable is invoked as the pagination program.
1.1 deraadt 248: .Sh FILES
1.4 deraadt 249: .Bl -tag -width /var/msgs/* -compact
250: .It Pa /var/msgs/*
1.1 deraadt 251: database
252: .It ~/.msgsrc
253: number of next message to be presented
254: .El
255: .Sh SEE ALSO
256: .Xr mail 1 ,
1.3 aaron 257: .Xr more 1 ,
1.5 aaron 258: .Xr newaliases 1 ,
1.3 aaron 259: .Xr aliases 5
1.5 aaron 260: .\".Xr crontab 5 ,
1.1 deraadt 261: .Sh HISTORY
262: The
263: .Nm msgs
264: command appeared in
265: .Bx 3.0 .