8 date 95.12.06.23.22.17; author jromine; state Exp;
13 date 94.04.21.19.11.44; author jromine; state Exp;
18 date 93.08.19.20.43.27; author jromine; state Exp;
23 date 92.10.29.22.01.56; author jromine; state Exp;
28 date 92.01.29.22.56.18; author jromine; state Exp;
33 date 91.01.07.11.13.47; author mh; state Exp;
38 date 90.04.05.15.10.08; author sources; state Exp;
43 date 90.03.22.11.31.50; author sources; state Exp;
48 date 90.03.20.19.42.32; author sources; state Exp;
53 date 90.03.20.17.36.47; author sources; state Exp;
58 date 90.03.20.10.24.48; author sources; state Exp;
63 date 90.03.18.20.48.49; author sources; state Exp;
68 date 90.03.16.15.51.59; author sources; state Exp;
73 date 90.03.16.15.47.47; author sources; state Exp;
84 @cleanup wording about "*" & missing Date: header
88 .\" @@(#)$Id: scan.rf,v 1.13 1994/04/21 19:11:44 jromine Exp jromine $
91 scan \- produce a one line per message scan listing
95 \%[\-clear] \%[\-noclear]
96 \%[\-form\ formatfile]
98 \%[\-header] \%[\-noheader]
100 \%[\-reverse] \%[\-noreverse]
104 \fIScan\fR produces a one\-line\-per\-message listing of the specified
106 Each \fIscan\fR line contains the message number (name),
107 the date, the \*(lqFrom:\*(rq field, the \*(lqSubject\*(rq field, and, if room
108 allows, some of the body of the message.
113 .ta \w'15+- 'u +\w'07/\|05x 'u +\w'Dcrocker 'u
114 15+ 07/\|05 Dcrocker nned\0\0\*(<<Last week I asked some of
115 16\0- 07/\|05 dcrocker message id format\0\0\*(<<I recommend
116 18 07/\|06 Obrien Re: Exit status from mkdir
117 19 07/\|07* Obrien \*(lqscan\*(rq listing format in MH
122 The `+' on message 15 indicates that it is the current message.
123 The `\-' on message 16 indicates that it has been
124 replied to, as indicated by a \*(lqReplied:\*(rq component (produced by
125 the `\-annotate' switch to the \fIrepl\fR command).
126 The `*' on message 19 indicates that there was no \*(lqDate:\*(rq
127 header present (the last write date of the message is given instead).
129 If there is sufficient room left on the \fIscan\fR line after the
130 subject, the line will be filled with text from the body,
131 preceded by <<, and terminated by >> if the body is sufficiently short.
132 \fIScan\fR actually reads each of the specified
133 messages and parses them to extract the desired fields.
134 During parsing, appropriate error messages will be produced if
135 there are format errors in any of the messages.
137 The `\-header' switch produces a header line prior to the \fIscan\fR
140 the name of the folder and the current date and time are output
141 (see the \fBHISTORY\fR section for more information).
143 If the `\-clear' switch is used and \fIscan's\fR output is directed to a
145 then \fIscan\fR will consult the \fB$TERM\fR and \fB$TERMCAP\fR
146 envariables to determine your
147 terminal type in order to find out how to clear the screen prior to exiting.
148 If the `\-clear' switch is used and \fIscan's\fR output is not directed to
149 a terminal (e.g., a pipe or a file),
150 then \fIscan\fR will send a formfeed prior to exiting.
152 For example, the command:
155 (scan \-clear \-header; show all \-show pr \-f) | lpr
157 produces a scan listing of the current folder, followed by a formfeed,
158 followed by a formatted listing of all messages in the folder, one per
159 page. Omitting `\-show\ pr\ \-f' will cause the messages to be concatenated,
160 separated by a one\-line header and two blank lines.
162 To override the output format used by \fIscan\fR,
163 the `\-format\ string' or `\-form\ file' switches are used.
164 This permits individual fields of the scan listing to be extracted with ease.
165 The string is simply a format string and the file is simply a format file.
166 See \fImh\-format\fR\0(5) for the details.
168 In addition to the standard \fImh\-format\fR\0(5) escapes,
169 \fIscan\fR also recognizes the following additional \fIcomponent\fR escapes:
172 .ta \w'Dtimenow 'u +\w'Returns 'u
173 \fIEscape\fR \fIReturns\fR \fIDescription\fR
174 body string the (compressed) first part of the body
175 dtimenow date the current date
176 folder string the name of the current folder
180 .\" and the following \fIfunction\fP escape:
183 .\" .ta \w'Dcompflagxfolderx 'u +\w'Returns 'u
184 .\" \fIEscape\fR \fIReturns\fR \fIDescription\fR
185 .\" compflag{folder} integer boolean state of `\-header'
189 If no date header is present in the message, the \fIfunction\fR
190 escapes which operate on {\fIdate\fP\|} will return values for the
191 date of last modification of the message file itself.
192 This is particularly handy for scanning a \fIdraft folder\fR,
193 as message drafts usually aren't allowed to have dates in them.
195 \fIscan\fR will update the \fIMH\fR context prior to starting the listing,
196 so interrupting a long \fIscan\fR listing preserves the new context.
197 \fIMH\fR purists hate this idea.
199 ^$HOME/\&.mh\(ruprofile~^The user profile
201 ^Path:~^To determine the user's MH directory
203 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
205 ^Current\-Folder:~^To find the default current folder
207 inc(1), pick(1), show(1), mh\-format(5)
209 `+folder' defaults to the folder current
211 `msgs' defaults to all
213 `\-format' defaulted as described above
217 `\-width' defaulted to the width of the terminal
219 If a folder is given, it will become the current folder.
221 Prior to using the format string mechanism,
222 `\-header' used to generate a heading saying what each column in the listing
224 Format strings prevent this from happening.
226 The argument to the `\-format' switch must be interpreted as a single token
227 by the shell that invokes \fIscan\fR.
229 one must usually place the argument to this switch inside double\-quotes.
232 each \fIcomponent\fR escape is set by \fIscan\fR to the contents
233 of the first message header \fIscan\fR encounters
234 with the corresponding component name;
235 any following headers with the same component name are ignored.
237 The switch `\-reverse', makes \fIscan\fR list the messages
238 in reverse order; this should be considered a bug.
240 The `\-file filename' switch allows the user to obtain a \fIscan\fP
241 listing of a maildrop file as produced by \fIpackf\fP. This listing
242 includes every message in the file. The user should use \fImsh\fP
243 for more selective processing of the file. `\-reverse' is ignored
251 @consider documenting compflag{folder}
256 .\" @@(#)$Id: scan.rf,v 1.12 1993/08/19 20:43:27 jromine Exp jromine $
259 .ta \w'15+- 'u +\w'7/\05 'u +\w'Dcrocker 'u
260 15+ 7/\05 Dcrocker nned\0\0\*(<<Last week I asked some of
261 16\0- 7/\05 dcrocker message id format\0\0\*(<<I recommend
262 18 7/\06 Obrien Re: Exit status from mkdir
263 19 7/\07 Obrien \*(lqscan\*(rq listing format in MH
266 replied to, as indicated by a \*(lqReplied:\*(rq component produced by
267 an `\-annotate' switch to the \fIrepl\fR command.
269 If \fIscan\fR encounters a message without a \*(lqDate:\*(rq field,
270 rather than leaving that portion of the scan listing blank,
271 the date is filled\-in with the last write date of the message,
272 and post\-fixed with a `*'.
273 This is particularly handy for scanning a \fIdraft folder\fR,
274 as message drafts usually aren't allowed to have dates in them.
278 Also, if no date header was present in the message, the \fIfunction\fR
290 .\" @@(#)$Id: scan.rf,v 1.11 1992/10/29 22:01:56 jromine Exp jromine $
302 .\" @@(#)$Id: scan.rf,v 1.10 1992/01/29 22:56:18 jromine Exp jromine $
305 the `\-format\ string' or `\-format\ file' switches are used.
316 .\" @@(#)$Id: scan.rf,v 1.9 1991/01/07 11:13:47 mh Exp jromine $
319 .ta \w'Escape 'u +\w'Returns 'u
328 @document scan -file filename
334 .\" @@(#)$Id: scan.rf,v 1.8 90/04/05 15:10:08 sources Exp Locker: mh $
337 \fIscan\fR also recognizes the following additional \fIcomponent\fR escape:
353 escapes which operate on {\fIdate\|} will return values for the
364 @put things back, do .NA stuff another way
378 .TH SCAN 1 @@(MHCENTERFOOT) @@(MHLEFTFOOT)
388 @fixup for makewhatis
399 @mention using st_mtime
414 @document component escape semantics
428 In addition to the standard escapes,
433 \fIMH\fR purists hate both of these ideas.
446 \fIscan\fR also recognizes the following additional escape:
450 \fIescape\fR \fIsubstitution\fR
451 body the (compressed) first part of the body
453 On hosts where \fIMH\fR was configured with the BERK option,
454 \fIscan\fR has two other switches: `\-reverse', and `\-noreverse'.
455 These make \fIscan\fR list the messages in reverse order.