1SCAN(1) [nmh-1.3] SCAN(1)
2
3
4
6 scan - produce a one line per message scan listing
7
9 scan [+folder] [msgs] [-clear | -noclear] [-form formatfile] [-format
10 string] [-header | -noheader] [-width columns] [-reverse | -nore‐
11 verse] [-file filename] [-version] [-help]
12
14 Scan produces a one-line-per-message listing of the specified folder or
15 messages. Each scan line contains the message number (name), the date,
16 the “From:” field, the “Subject” field, and, if room allows, some of
17 the body of the message. For example:
18
19 15+ 10/05 crocker nned Last week I asked some of
20 16- 10/05 crocker message id format I recommend
21 18 10/06 brien Re: Exit status from mkdir
22 19 10/07*brien “scan” listing format in nmh
23
24 The `+' on message 15 indicates that it is the current message.
25
26 The `-' on message 16 indicates that it has been replied to, as indi‐
27 cated by a “Replied:” component (produced by the -annotate switch to
28 the repl command).
29
30 The `*' on message 19 indicates that no “Date:” header was present.
31 The time of last modification of the message is given instead.
32
33 If there is sufficient room left on the scan line after the subject,
34 the line will be filled with text from the body, preceded by “<<”, and
35 terminated by “>>” if the body is sufficiently short. Scan actually
36 reads each of the specified messages and parses them to extract the
37 desired fields. During parsing, appropriate error messages will be
38 produced if there are format errors in any of the messages.
39
40 By default, scan will decode RFC-2047 (MIME) encoding in these scan
41 listings. Scan will only decode these fields if your terminal can
42 natively display the character set used in the encoding. You should
43 set the MM_CHARSET environment variable to your native character set,
44 if it is not US-ASCII. See the mh-profile(5) man page for details
45 about this environment variable.
46
47 The switch -reverse, makes scan list the messages in reverse order.
48
49 The -file filename switch allows the user to obtain a scan listing of a
50 maildrop file as produced by packf. This listing includes every mes‐
51 sage in the file (you can't scan individual messages). The switch
52 -reverse is ignored with this option.
53
54 The switch -width columns may be used to specify the width of the scan
55 line. The default is to use the width of the terminal.
56
57 The -header switch produces a header line prior to the scan listing.
58 Currently, the name of the folder and the current date and time are
59 output (see the HISTORY section for more information).
60
61 If the -clear switch is used and scan's output is directed to a termi‐
62 nal, then scan will consult the environment variables $TERM and $TERM‐
63 CAP to determine your terminal type in order to find out how to clear
64 the screen prior to exiting. If the -clear switch is used and scan's
65 output is not directed to a terminal (e.g., a pipe or a file), then
66 scan will send a formfeed prior to exiting.
67
68 For example, the command:
69
70 (scan -clear -header; show all -show pr -f) | lpr
71
72 produces a scan listing of the current folder, followed by a formfeed,
73 followed by a formatted listing of all messages in the folder, one per
74 page. Omitting “-show pr -f” will cause the messages to be concate‐
75 nated, separated by a one-line header and two blank lines.
76
77 To override the output format used by scan, the -format string or -form
78 file switches are used. This permits individual fields of the scan
79 listing to be extracted with ease. The string is simply a format
80 string and the file is simply a format file. See mh-format(5) for the
81 details.
82
83 In addition to the standard mh-format(5) escapes, scan also recognizes
84 the following additional component escapes:
85
86 Escape Returns Description
87 body string the (compressed) first part of the body
88 dtimenow date the current date
89 folder string the name of the current folder
90
91 If no date header is present in the message, the function escapes which
92 operate on {date} will return values for the date of last modification
93 of the message file itself. This feature is handy for scanning a draft
94 folder, as message drafts usually aren't allowed to have dates in them.
95
96 scan will update the nmh context prior to starting the listing, so
97 interrupting a long scan listing preserves the new context. nmh
98 purists hate this idea.
99
100
102 $HOME/.mh_profile The user profile
103
104
106 Path: To determine the user's nmh directory
107 Alternate-Mailboxes: To determine the user's mailboxes
108 Current-Folder: To find the default current folder
109
110
112 inc(1), pick(1), show(1), mh-format(5)
113
114
116 `+folder' defaults to the current folder
117 `msgs' defaults to all
118 `-format' defaulted as described above
119 `-noheader'
120 `-width' defaulted to the width of the terminal
121
122
124 If a folder is given, it will become the current folder.
125
126
128 Prior to using the format string mechanism, -header used to generate a
129 heading saying what each column in the listing was. Format strings
130 prevent this from happening.
131
132
134 The argument to the -format switch must be interpreted as a single
135 token by the shell that invokes scan. Therefore, one must usually
136 place the argument to this switch inside double-quotes.
137
138 The value of each component escape is set by scan to the contents of
139 the first message header scan encounters with the corresponding compo‐
140 nent name; any following headers with the same component name are
141 ignored.
142
143
144
145MH.6.8 1 June 2008 SCAN(1)