5 .\" include the -mh macro file
8 .TH SCAN %manext1% MH.6.8 [%nmhversion%]
10 scan \- produce a one line per message scan listing
16 \%[\-clear] \%[\-noclear]
17 \%[\-form\ formatfile]
19 \%[\-header] \%[\-noheader]
21 \%[\-reverse] \%[\-noreverse]
28 \fIScan\fR produces a one\-line\-per\-message listing of the specified
29 folder or messages. Each \fIscan\fR line contains the message number
30 (name), the date, the \*(lqFrom:\*(rq field, the \*(lqSubject\*(rq field,
31 and, if room allows, some of the body of the message. For example:
35 .ta \w'15+- 'u +\w'07/\|05x 'u +\w'Dcrocker 'u
36 15+ 10/\|05 crocker nned\0\0\*(<<Last week I asked some of
37 16\- 10/\|05 crocker message id format\0\0\*(<<I recommend
38 18 10/\|06 brien Re: Exit status from mkdir
39 19 10/\|07*brien \*(lqscan\*(rq listing format in nmh
44 The `+' on message 15 indicates that it is the current message.
46 The `\-' on message 16 indicates that it has been replied to, as indicated
47 by a \*(lqReplied:\*(rq component (produced by the `\-annotate' switch
48 to the \fIrepl\fR command).
50 The `*' on message 19 indicates that no \*(lqDate:\*(rq header was
51 present. The time of last modification of the message is given instead.
53 If there is sufficient room left on the \fIscan\fR line after the
54 subject, the line will be filled with text from the body, preceded by
55 <<, and terminated by >> if the body is sufficiently short. \fIScan\fR
56 actually reads each of the specified messages and parses them to extract
57 the desired fields. During parsing, appropriate error messages will be
58 produced if there are format errors in any of the messages.
60 By default, \fIscan\fR will decode RFC-2047 (MIME) encoding in
61 these scan listings. \fIScan\fR will only decode these fields if your
62 terminal can natively display the character set used in the encoding.
63 You should set the MM_CHARSET environment variable to your native
64 character set, if it is not US-ASCII. See the mh-profile(5) man
65 page for details about this environment variable.
67 The switch `\-reverse', makes \fIscan\fR list the messages in reverse
70 The `\-file filename' switch allows the user to obtain a \fIscan\fP
71 listing of a maildrop file as produced by \fIpackf\fP. This listing
72 includes every message in the file (you can't scan individual messages).
73 The switch `\-reverse' is ignored with this option.
75 The switch `\-width\ columns' may be used to specify the width of
76 the scan line. The default is to use the width of the terminal.
78 The `\-header' switch produces a header line prior to the \fIscan\fR
79 listing. Currently, the name of the folder and the current date and
80 time are output (see the \fBHISTORY\fR section for more information).
82 If the `\-clear' switch is used and \fIscan's\fR output is directed
83 to a terminal, then \fIscan\fR will consult the environment variables
84 \fB$TERM\fR and \fB$TERMCAP\fR to determine your terminal type in order
85 to find out how to clear the screen prior to exiting. If the `\-clear'
86 switch is used and \fIscan's\fR output is not directed to a terminal
87 (e.g., a pipe or a file), then \fIscan\fR will send a formfeed prior
90 For example, the command:
93 (scan \-clear \-header; show all \-show pr \-f) | lpr
95 produces a scan listing of the current folder, followed by a formfeed,
96 followed by a formatted listing of all messages in the folder, one
97 per page. Omitting `\-show\ pr\ \-f' will cause the messages to be
98 concatenated, separated by a one\-line header and two blank lines.
100 To override the output format used by \fIscan\fR, the `\-format\ string'
101 or `\-form\ file' switches are used. This permits individual fields of
102 the scan listing to be extracted with ease. The string is simply a format
103 string and the file is simply a format file. See \fImh\-format\fR(5)
106 In addition to the standard \fImh\-format\fR(5) escapes, \fIscan\fR
107 also recognizes the following additional \fIcomponent\fR escapes:
110 .ta \w'Dtimenow 'u +\w'Returns 'u
111 \fIEscape\fR \fIReturns\fR \fIDescription\fR
112 body string the (compressed) first part of the body
113 dtimenow date the current date
114 folder string the name of the current folder
118 If no date header is present in the message, the \fIfunction\fR escapes
119 which operate on {\fIdate\fP\|} will return values for the date of last
120 modification of the message file itself. This feature is handy for
121 scanning a \fIdraft folder\fR, as message drafts usually aren't allowed
122 to have dates in them.
124 \fIscan\fR will update the \fInmh\fR context prior to starting the listing,
125 so interrupting a long \fIscan\fR listing preserves the new context.
126 \fInmh\fR purists hate this idea.
128 ^$HOME/\&.mh\(ruprofile~^The user profile
130 ^Path:~^To determine the user's nmh directory
132 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
134 ^Current\-Folder:~^To find the default current folder
136 inc(1), pick(1), show(1), mh\-format(5)
138 `+folder' defaults to the current folder
140 `msgs' defaults to all
142 `\-format' defaulted as described above
146 `\-width' defaulted to the width of the terminal
148 If a folder is given, it will become the current folder.
150 Prior to using the format string mechanism, `\-header' used to generate
151 a heading saying what each column in the listing was. Format strings
152 prevent this from happening.
154 The argument to the `\-format' switch must be interpreted as a single
155 token by the shell that invokes \fIscan\fR. Therefore, one must usually
156 place the argument to this switch inside double\-quotes.
158 The value of each \fIcomponent\fR escape is set by \fIscan\fR to the
159 contents of the first message header \fIscan\fR encounters with the
160 corresponding component name; any following headers with the same
161 component name are ignored.