1SCAN(1)                     General Commands Manual                    SCAN(1)
2
3
4

NAME

6       scan - produce a summary listing of nmh messages
7

SYNOPSIS

9       scan [-help] [-version] [+folder] [msgs] [-clear | -noclear] [-form
10            formatfile] [-format string] [-header | -noheader] [-width col‐
11            umns] [-reverse | -noreverse] [-file filename]
12

DESCRIPTION

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  appropriate  locale(1)  environment  variables to your native
44       character set, if it is not US-ASCII.  See locale(1) for  more  details
45       on the appropriate environment variables.
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       mail drop 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       {body} returns a string without MIME decoding, i.e. the  MIME  boundary
92       seperator may be the first text shown.
93
94       If no date header is present in the message, the function escapes which
95       operate on {date} will return values for the date of last  modification
96       of the message file itself.  This feature is handy for scanning a draft
97       folder, as message drafts usually aren't allowed to have dates in them.
98
99       The /etc/nmh directory contains several format  files  as  examples  of
100       customized scan output.
101
102       scan  will  update  the  nmh  context prior to starting the listing, so
103       interrupting a long  scan  listing  preserves  the  new  context.   nmh
104       purists hate this idea.
105

FILES

107       $HOME/.mh_profile          The user profile
108

PROFILE COMPONENTS

110       Path:                To determine the user's nmh directory
111       Alternate-Mailboxes: To determine the user's mailboxes
112       Current-Folder:      To find the default current folder
113

SEE ALSO

115       pick(1), show(1), mh-format(5)
116

DEFAULTS

118       `+folder' defaults to the current folder
119       `msgs' defaults to all
120       `-format' defaulted as described above
121       `-noheader'
122       `-width' defaulted to the width of the terminal
123

CONTEXT

125       If a folder is given, it will become the current folder.
126

HISTORY

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

BUGS

133       The  value  of  each component escape is set by scan to the contents of
134       the first message header scan encounters with the corresponding  compo‐
135       nent  name;  any  following  headers  with  the same component name are
136       ignored.
137
138
139
140nmh-1.7.1                         2014-01-20                           SCAN(1)
Impressum