xref: /original-bsd/usr.bin/msgs/msgs.1 (revision 95a66346)
1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)msgs.1	6.7 (Berkeley) 03/14/91
7.\"
8.Vx
9.Vx
10.Dd
11.Dt MSGS 1
12.Os BSD 4
13.Sh NAME
14.Nm msgs
15.Nd system messages and junk mail program
16.Sh SYNOPSIS
17.Nm msgs
18.Op Fl fhlpq
19.Op Ar number
20.Op Ar \-number
21.Pp
22.Nm msgs
23.Op Fl s
24.Pp
25.Nm msgs
26.Op Fl c
27.Op \-days
28.Sh DESCRIPTION
29.Nm Msgs
30is used to read system messages.
31These messages are
32sent by mailing to the login `msgs' and should be short
33pieces of information which are suitable to be read once by most users
34of the system.
35.Pp
36.Nm Msgs
37is normally invoked each time you login, by placing it in the file
38.Pa \& .login
39(or
40.Pa \&.profile
41if you use
42.Xr sh 1 ) .
43It will then prompt you with the source and subject of each new message.
44If there is no subject line, the first few non-blank lines of the
45message will be displayed.
46If there is more to the message, you will be told how
47long it is and asked whether you wish to see the rest of the message.
48The possible responses are:
49.Tw Fl
50.Tp Fl y
51type the rest of the message.
52.Tp Ic RETURN
53synonym for y.
54.Tp Fl n
55skip this message
56and go on to the next message.
57.Tp Fl
58redisplay the last message.
59.Tp Fl q
60drops you out of
61.Nm msgs ;
62the next time you run the program it will pick up where you left off.
63.Tp Fl s
64append the current message to the file ``Messages'' in the current directory;
65`s\-' will save the previously displayed message. A `s' or `s\-' may
66be followed by a space and a file name to receive the message replacing
67the default ``Messages''.
68.Tp Fl m
69or `m\-' causes a copy of the specified message to be placed in a temporary
70mailbox and
71.Xr mail  1
72to be invoked on that mailbox.
73Both `m' and `s' accept a numeric argument in place of the `\-'.
74.Tp
75.Pp
76.Nm Msgs
77keeps track of the next message you will see by a number in the file
78.Pa \&.msgsrc
79in your home directory.
80In the directory
81.Pa /var/msgs
82it keeps a set of files whose names are the (sequential) numbers
83of the messages they represent.
84The file
85.Pa /var/msgs/bounds
86shows the low and high number of the messages in the directory
87so that
88.Nm msgs
89can quickly determine if there are no messages for you.
90If the contents of
91.Pa bounds
92is incorrect it can be fixed by removing it;
93.Nm msgs
94will make a new
95.Pa bounds
96file the next time it is run.
97.Pp
98The
99.Fl s
100option is used for setting up the posting of messages.  The line
101.Pp
102.Dl msgs: \&"\&| /usr/ucb/msgs \-s\&"
103.Pp
104should be included in
105.Pa /etc/aliases
106(see
107.Xr newaliases 1 )
108to enable posting of messages.
109.Pp
110The
111.Fl c
112option is used for performing cleanup on
113.Pa /var/msgs.
114An entry with the
115.Fl c
116option should be placed in
117.Pa /etc/crontab
118to run every night.  This will remove all messages over 21 days old.
119A different expiration may be specified on the command line to override
120the default.
121.Pp
122Options when reading messages include:
123.Tw Fl
124.Tp Fl f
125which causes it not to say ``No new messages.''.
126This is useful in your
127.Pa \& .login
128file since this is often the case here.
129.Tp Fl q
130Queries whether there are messages, printing
131``There are new messages.'' if there are.
132The command ``msgs \-q'' is often used in login scripts.
133.Tp Fl h
134causes
135.Nm msgs
136to print the first part of messages only.
137.Tp Fl l
138option causes only locally originated messages to be reported.
139.Tp Ar num
140A message number can be given
141on the command line, causing
142.Nm msgs
143to start at the specified message rather than at the next message
144indicated by your
145.Pa \&.msgsrc
146file.
147Thus
148.Pp
149.Dl msgs \-h 1
150.Pp
151prints the first part of all messages.
152.Tp Ar \-number
153will cause
154.Nm msgs
155to start
156.Ar number
157messages back from the one indicated by your
158.Pa \&.msgsrc
159file, useful for reviews of recent messages.
160.Tp Fl p
161causes long messages to be piped through
162.Xr more  1  .
163.Tp
164.Pp
165Within
166.Nm msgs
167you can also go to any specific message by typing its number when
168.Nm msgs
169requests input as to what to do.
170.Sh ENVIRONMENT
171.Nm Msgs
172uses the
173.Ev HOME
174and
175.Ev TERM
176environment variables for the default home directory and
177terminal type.
178.Sh FILES
179.Dw /usr/msgs/*
180.Di L
181.Dp Pa /usr/msgs/*
182database
183.Dp ~/.msgsrc
184number of next message to be presented
185.Dp
186.Sh AUTHORS
187William Joy
188.br
189David Wasley
190.Sh SEE ALSO
191.Xr aliases 5 ,
192.\".Xr crontab 5 ,
193.Xr mail 1 ,
194.Xr more 1
195.Sh HISTORY
196.Nm Msgs
197appeared in 3 BSD.
198.Sh BUGS
199