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