]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/msgs/msgs.1
zfs: merge openzfs/zfs@887a3c533
[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 .\"     @(#)msgs.1      8.2 (Berkeley) 4/28/95
29 .\"
30 .Dd August 8, 2018
31 .Dt MSGS 1
32 .Os
33 .Sh NAME
34 .Nm msgs
35 .Nd system messages and junk mail program
36 .Sh SYNOPSIS
37 .Nm
38 .Op Fl fhlpq
39 .Op Ar number
40 .Op Ar \-number
41 .Nm
42 .Op Fl s
43 .Nm
44 .Op Fl c
45 .Op \-days
46 .Sh DESCRIPTION
47 The
48 .Nm
49 utility is used to read system messages.
50 These messages are
51 sent by mailing to the login `msgs' and should be short
52 pieces of information which are suitable to be read once by most users
53 of the system.
54 .Pp
55 The
56 .Nm
57 utility is normally invoked each time you login, by placing it in the file
58 .Pa .login
59 (or
60 .Pa .profile
61 if you use
62 .Xr sh 1 ) .
63 It will then prompt you with the source and subject of each new message.
64 If there is no subject line, the first few non-blank lines of the
65 message will be displayed.
66 If there is more to the message, you will be told how
67 long it is and asked whether you wish to see the rest of the message.
68 The possible responses are:
69 .Bl -tag -width Fl
70 .It Fl y
71 Type the rest of the message.
72 .It Ic RETURN
73 Synonym for y.
74 .It Fl n
75 Skip this message
76 and go on to the next message.
77 .It Fl
78 Redisplay the last message.
79 .It Fl q
80 Drop out of
81 .Nm ;
82 the next time
83 .Nm
84 will pick up where it last left off.
85 .It Fl s
86 Append the current message to the file ``Messages'' in the current directory;
87 `s\-' will save the previously displayed message.
88 A `s' or `s\-' may
89 be followed by a space and a file name to receive the message replacing
90 the default ``Messages''.
91 .It Fl m
92 A copy of the specified message is placed in a temporary
93 mailbox and
94 .Xr mail 1
95 is invoked on that mailbox.
96 Both `m' and `s' accept a numeric argument in place of the `\-'.
97 .El
98 .Pp
99 The
100 .Nm
101 utility keeps track of the next message you will see by a number in the file
102 .Pa \&.msgsrc
103 in your home directory.
104 In the directory
105 .Pa /var/msgs
106 it keeps a set of files whose names are the (sequential) numbers
107 of the messages they represent.
108 The file
109 .Pa /var/msgs/bounds
110 shows the low and high number of the messages in the directory
111 so that
112 .Nm
113 can quickly determine if there are no messages for you.
114 If the contents of
115 .Pa bounds
116 is incorrect it can be fixed by removing it;
117 .Nm
118 will make a new
119 .Pa bounds
120 file the next time it is run with the
121 .Fl s
122 option.
123 If
124 .Nm
125 is run with any option other than
126 .Fl s ,
127 an error will be displayed if
128 .Pa /var/msgs/bounds
129 does not exist.
130 .Pp
131 The
132 .Fl s
133 option is used for setting up the posting of messages.
134 The line
135 .Pp
136 .Dl msgs: \&"\&| /usr/bin/msgs \-s\&"
137 .Pp
138 should be included in
139 .Pa /etc/mail/aliases
140 (see
141 .Xr newaliases 1 )
142 to enable posting of messages.
143 .Pp
144 The
145 .Fl c
146 option is used for performing cleanup on
147 .Pa /var/msgs .
148 A shell script entry to run
149 .Nm
150 with the
151 .Fl c
152 option should be placed in
153 .Pa /etc/periodic/daily
154 (see
155 .Xr periodic 8 )
156 to run every night.
157 This will remove all messages over 21 days old.
158 A different expiration may be specified on the command line to override
159 the default.
160 You must be the superuser to use this option.
161 .Pp
162 Options when reading messages include:
163 .Bl -tag -width Fl
164 .It Fl f
165 Do not say ``No new messages.''.
166 This is useful in a
167 .Pa .login
168 file since this is often the case here.
169 .It Fl q
170 Queries whether there are messages, printing
171 ``There are new messages.'' if there are.
172 The command ``msgs \-q'' is often used in login scripts.
173 .It Fl h
174 Print the first part of messages only.
175 .It Fl l
176 Cause only locally originated messages to be reported.
177 .It Ar num
178 A message number can be given
179 on the command line, causing
180 .Nm
181 to start at the specified message rather than at the next message
182 indicated by your
183 .Pa \&.msgsrc
184 file.
185 Thus
186 .Pp
187 .Dl msgs \-h 1
188 .Pp
189 prints the first part of all messages.
190 .It Ar \-number
191 Start
192 .Ar number
193 messages back from the one indicated in the
194 .Pa \&.msgsrc
195 file, useful for reviews of recent messages.
196 .It Fl p
197 Pipe long messages through
198 .Xr less 1 .
199 .El
200 .Pp
201 Within
202 .Nm
203 you can also go to any specific message by typing its number when
204 .Nm
205 requests input as to what to do.
206 .Sh ENVIRONMENT
207 The
208 .Nm
209 utility uses the
210 .Ev HOME
211 and
212 .Ev TERM
213 environment variables for the default home directory and
214 terminal type.
215 .Sh FILES
216 .Bl -tag -width /var/msgs/* -compact
217 .It Pa /var/msgs/*
218 database
219 .It Pa ~/.msgsrc
220 number of next message to be presented
221 .El
222 .Sh SEE ALSO
223 .Xr mail 1 ,
224 .Xr less 1 ,
225 .Xr aliases 5 ,
226 .Xr periodic 8
227 .Sh HISTORY
228 The
229 .Nm
230 command appeared in
231 .Bx 3.0 .