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