Annotation of src/usr.bin/msgs/msgs.1, Revision 1.2
1.2 ! deraadt 1: .\" $OpenBSD: msgs.1,v 1.5 1995/09/28 06:57:39 tls 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
54: .Nm Msgs
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
61: .Nm Msgs
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
75: .It Fl y
76: Type the rest of the message.
77: .It Ic RETURN
78: Synonym for y.
79: .It Fl n
80: Skip this message
81: and go on to the next message.
82: .It Fl
83: Redisplay the last message.
84: .It Fl q
85: Drop out of
86: .Nm msgs ;
87: the next time
88: .Nm msgs
89: will pick up where it last left off.
90: .It Fl s
91: Append the current message to the file ``Messages'' in the current directory;
92: `s\-' will save the previously displayed message. A `s' or `s\-' may
93: be followed by a space and a file name to receive the message replacing
94: the default ``Messages''.
95: .It Fl m
96: A copy of the specified message is placed in a temporary
97: mailbox and
98: .Xr mail 1
99: is invoked on that mailbox.
100: .It Fl p
101: The specified message is piped through $PAGER, or, if $PAGER is not defined,
102: .Xr more 1 .
103: The commands `m', `p', and `s' all accept a numeric argument in place of the `\-'.
104: .El
105: .Pp
106: .Nm Msgs
107: keeps track of the next message you will see by a number in the file
108: .Pa \&.msgsrc
109: in your home directory.
110: In the directory
111: .Pa /var/msgs
112: it keeps a set of files whose names are the (sequential) numbers
113: of the messages they represent.
114: The file
115: .Pa /var/msgs/bounds
116: shows the low and high number of the messages in the directory
117: so that
118: .Nm msgs
119: can quickly determine if there are no messages for you.
120: If the contents of
121: .Pa bounds
122: is incorrect it can be fixed by removing it;
123: .Nm msgs
124: will make a new
125: .Pa bounds
126: file the next time it is run.
127: .Pp
128: The
129: .Fl s
130: option is used for setting up the posting of messages. The line
131: .Pp
132: .Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
133: .Pp
134: should be included in
135: .Pa /etc/aliases
136: (see
137: .Xr newaliases 1 )
138: to enable posting of messages.
139: .Pp
140: The
141: .Fl c
142: option is used for performing cleanup on
143: .Pa /var/msgs.
144: An entry with the
145: .Fl c
146: option should be placed in
147: .Pa /etc/crontab
148: to run every night. This will remove all messages over 21 days old.
149: A different expiration may be specified on the command line to override
150: the default.
151: .Pp
152: Options when reading messages include:
153: .Bl -tag -width Fl
154: .It Fl f
155: Do not to say ``No new messages.''.
156: This is useful in a
157: .Pa .login
158: file since this is often the case here.
159: .It Fl q
160: Queries whether there are messages, printing
161: ``There are new messages.'' if there are.
162: The command ``msgs \-q'' is often used in login scripts.
163: .It Fl h
164: Print the first part of messages only.
165: .It Fl r
166: Disables the ability to save messages or enter the mailer. It is
167: assumed that $PAGER is set to something secure.
168: .It Fl l
169: Option causes only locally originated messages to be reported.
170: .It Ar num
171: A message number can be given
172: on the command line, causing
173: .Nm msgs
174: to start at the specified message rather than at the next message
175: indicated by your
176: .Pa \&.msgsrc
177: file.
178: Thus
179: .Pp
180: .Dl msgs \-h 1
181: .Pp
182: prints the first part of all messages.
183: .It Ar \-number
184: Start
185: .Ar number
186: messages back from the one indicated in the
187: .Pa \&.msgsrc
188: file, useful for reviews of recent messages.
189: .It Fl p
190: Pipe long messages through $PAGER, or, if $PAGER is not defined,
191: .Xr more 1 .
192: .El
193: .Pp
194: Within
195: .Nm msgs
196: you can also go to any specific message by typing its number when
197: .Nm msgs
198: requests input as to what to do.
199: .Sh ENVIRONMENT
200: .Nm Msgs
201: uses the
202: .Ev HOME
203: and
204: .Ev TERM
205: environment variables for the default home directory and
206: terminal type.
207: .Sh FILES
208: .Bl -tag -width /usr/msgs/* -compact
209: .It Pa /usr/msgs/*
210: database
211: .It ~/.msgsrc
212: number of next message to be presented
213: .El
214: .Sh SEE ALSO
215: .Xr aliases 5 ,
216: .\".Xr crontab 5 ,
217: .Xr mail 1 ,
218: .Xr more 1
219: .Sh HISTORY
220: The
221: .Nm msgs
222: command appeared in
223: .Bx 3.0 .