Commit | Line | Data |
---|---|---|
ad787160 C |
1 | .\" @(MHWARNING) |
2 | .\" @(#)$Id: scan.rf,v 1.11 1992/10/29 22:01:56 jromine Exp $ | |
29a3a89d C |
3 | .SC SCAN 1 |
4 | .NA | |
5 | scan \- produce a one line per message scan listing | |
6 | .SY | |
7 | scan | |
8 | \%[+folder] \%[msgs] | |
9 | \%[\-clear] \%[\-noclear] | |
10 | \%[\-form\ formatfile] | |
11 | \%[\-format\ string] | |
12 | \%[\-header] \%[\-noheader] | |
13 | \%[\-width\ columns] | |
ad787160 C |
14 | \%[\-reverse] \%[\-noreverse] |
15 | \%[\-file filename] | |
29a3a89d C |
16 | \%[\-help] |
17 | .DE | |
18 | \fIScan\fR produces a one\-line\-per\-message listing of the specified | |
19 | messages. | |
20 | Each \fIscan\fR line contains the message number (name), | |
21 | the date, the \*(lqFrom:\*(rq field, the \*(lqSubject\*(rq field, and, if room | |
22 | allows, some of the body of the message. | |
23 | For example: | |
24 | ||
25 | .nf | |
26 | .in +.5i | |
27 | .ta \w'15+- 'u +\w'7/\05 'u +\w'Dcrocker 'u | |
28 | 15+ 7/\05 Dcrocker nned\0\0\*(<<Last week I asked some of | |
29 | 16\0- 7/\05 dcrocker message id format\0\0\*(<<I recommend | |
30 | 18 7/\06 Obrien Re: Exit status from mkdir | |
31 | 19 7/\07 Obrien \*(lqscan\*(rq listing format in MH | |
32 | .re | |
33 | .in -.5i | |
34 | .fi | |
35 | ||
36 | The `+' on message 15 indicates that it is the current message. | |
37 | The `\-' on message 16 indicates that it has been | |
38 | replied to, as indicated by a \*(lqReplied:\*(rq component produced by | |
39 | an `\-annotate' switch to the \fIrepl\fR command. | |
40 | ||
41 | If there is sufficient room left on the \fIscan\fR line after the | |
42 | subject, the line will be filled with text from the body, | |
43 | preceded by <<, and terminated by >> if the body is sufficiently short. | |
44 | \fIScan\fR actually reads each of the specified | |
45 | messages and parses them to extract the desired fields. | |
46 | During parsing, appropriate error messages will be produced if | |
47 | there are format errors in any of the messages. | |
48 | ||
49 | The `\-header' switch produces a header line prior to the \fIscan\fR | |
50 | listing. | |
51 | Currently, | |
52 | the name of the folder and the current date and time are output | |
53 | (see the \fBHISTORY\fR section for more information). | |
54 | ||
55 | If the `\-clear' switch is used and \fIscan's\fR output is directed to a | |
56 | terminal, | |
57 | then \fIscan\fR will consult the \fB$TERM\fR and \fB$TERMCAP\fR | |
ad787160 | 58 | envariables to determine your |
29a3a89d C |
59 | terminal type in order to find out how to clear the screen prior to exiting. |
60 | If the `\-clear' switch is used and \fIscan's\fR output is not directed to | |
61 | a terminal (e.g., a pipe or a file), | |
62 | then \fIscan\fR will send a formfeed prior to exiting. | |
63 | ||
64 | For example, the command: | |
65 | ||
66 | .ti +.5i | |
67 | (scan \-clear \-header; show all \-show pr \-f) | lpr | |
68 | ||
69 | produces a scan listing of the current folder, followed by a formfeed, | |
70 | followed by a formatted listing of all messages in the folder, one per | |
71 | page. Omitting `\-show\ pr\ \-f' will cause the messages to be concatenated, | |
72 | separated by a one\-line header and two blank lines. | |
73 | ||
74 | If \fIscan\fR encounters a message without a \*(lqDate:\*(rq field, | |
75 | rather than leaving that portion of the scan listing blank, | |
76 | the date is filled\-in with the last write date of the message, | |
77 | and post\-fixed with a `*'. | |
78 | This is particularly handy for scanning a \fIdraft folder\fR, | |
79 | as message drafts usually aren't allowed to have dates in them. | |
80 | ||
81 | To override the output format used by \fIscan\fR, | |
82 | the `\-format\ string' or `\-format\ file' switches are used. | |
83 | This permits individual fields of the scan listing to be extracted with ease. | |
84 | The string is simply a format string and the file is simply a format file. | |
85 | See \fImh\-format\fR\0(5) for the details. | |
86 | ||
ad787160 C |
87 | In addition to the standard \fImh\-format\fR\0(5) escapes, |
88 | \fIscan\fR also recognizes the following additional \fIcomponent\fR escapes: | |
89 | .sp 1 | |
29a3a89d | 90 | .nf |
ad787160 C |
91 | .ta \w'Dtimenow 'u +\w'Returns 'u |
92 | \fIEscape\fR \fIReturns\fR \fIDescription\fR | |
93 | body string the (compressed) first part of the body | |
94 | dtimenow date the current date | |
95 | folder string the name of the current folder | |
29a3a89d C |
96 | .re |
97 | .fi | |
98 | ||
ad787160 C |
99 | Also, if no date header was present in the message, the \fIfunction\fR |
100 | escapes which operate on {\fIdate\fP\|} will return values for the | |
101 | date of last modification of the message file itself. | |
102 | ||
29a3a89d C |
103 | \fIscan\fR will update the \fIMH\fR context prior to starting the listing, |
104 | so interrupting a long \fIscan\fR listing preserves the new context. | |
ad787160 | 105 | \fIMH\fR purists hate this idea. |
29a3a89d C |
106 | .Fi |
107 | ^$HOME/\&.mh\(ruprofile~^The user profile | |
108 | .Pr | |
109 | ^Path:~^To determine the user's MH directory | |
110 | .Ps | |
111 | ^Alternate\-Mailboxes:~^To determine the user's mailboxes | |
112 | .Ps | |
113 | ^Current\-Folder:~^To find the default current folder | |
114 | .Sa | |
115 | inc(1), pick(1), show(1), mh\-format(5) | |
116 | .De | |
117 | `+folder' defaults to the folder current | |
118 | .Ds | |
119 | `msgs' defaults to all | |
120 | .Ds | |
121 | `\-format' defaulted as described above | |
122 | .Ds | |
123 | `\-noheader' | |
124 | .Ds | |
125 | `\-width' defaulted to the width of the terminal | |
126 | .Co | |
127 | If a folder is given, it will become the current folder. | |
128 | .Hi | |
129 | Prior to using the format string mechanism, | |
130 | `\-header' used to generate a heading saying what each column in the listing | |
131 | was. | |
132 | Format strings prevent this from happening. | |
133 | .Bu | |
134 | The argument to the `\-format' switch must be interpreted as a single token | |
135 | by the shell that invokes \fIscan\fR. | |
136 | Therefore, | |
137 | one must usually place the argument to this switch inside double\-quotes. | |
ad787160 C |
138 | .br |
139 | The value of | |
140 | each \fIcomponent\fR escape is set by \fIscan\fR to the contents | |
141 | of the first message header \fIscan\fR encounters | |
142 | with the corresponding component name; | |
143 | any following headers with the same component name are ignored. | |
144 | .sp | |
145 | The switch `\-reverse', makes \fIscan\fR list the messages | |
146 | in reverse order; this should be considered a bug. | |
147 | .sp | |
148 | The `\-file filename' switch allows the user to obtain a \fIscan\fP | |
149 | listing of a maildrop file as produced by \fIpackf\fP. This listing | |
150 | includes every message in the file. The user should use \fImsh\fP | |
151 | for more selective processing of the file. `\-reverse' is ignored | |
152 | with this option. | |
29a3a89d | 153 | .En |