BSD 4_4 release
[unix-history] / usr / src / contrib / mh-6.8 / conf / doc / scan.rf
CommitLineData
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
5scan \- produce a one line per message scan listing
6.SY
7scan
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
19messages.
20Each \fIscan\fR line contains the message number (name),
21the date, the \*(lqFrom:\*(rq field, the \*(lqSubject\*(rq field, and, if room
22allows, some of the body of the message.
23For example:
24
25.nf
26.in +.5i
27.ta \w'15+- 'u +\w'7/\05 'u +\w'Dcrocker 'u
2815+ 7/\05 Dcrocker nned\0\0\*(<<Last week I asked some of
2916\0- 7/\05 dcrocker message id format\0\0\*(<<I recommend
3018 7/\06 Obrien Re: Exit status from mkdir
3119 7/\07 Obrien \*(lqscan\*(rq listing format in MH
32.re
33.in -.5i
34.fi
35
36The `+' on message 15 indicates that it is the current message.
37The `\-' on message 16 indicates that it has been
38replied to, as indicated by a \*(lqReplied:\*(rq component produced by
39an `\-annotate' switch to the \fIrepl\fR command.
40
41If there is sufficient room left on the \fIscan\fR line after the
42subject, the line will be filled with text from the body,
43preceded by <<, and terminated by >> if the body is sufficiently short.
44\fIScan\fR actually reads each of the specified
45messages and parses them to extract the desired fields.
46During parsing, appropriate error messages will be produced if
47there are format errors in any of the messages.
48
49The `\-header' switch produces a header line prior to the \fIscan\fR
50listing.
51Currently,
52the name of the folder and the current date and time are output
53(see the \fBHISTORY\fR section for more information).
54
55If the `\-clear' switch is used and \fIscan's\fR output is directed to a
56terminal,
57then \fIscan\fR will consult the \fB$TERM\fR and \fB$TERMCAP\fR
ad787160 58envariables to determine your
29a3a89d
C
59terminal type in order to find out how to clear the screen prior to exiting.
60If the `\-clear' switch is used and \fIscan's\fR output is not directed to
61a terminal (e.g., a pipe or a file),
62then \fIscan\fR will send a formfeed prior to exiting.
63
64For example, the command:
65
66.ti +.5i
67(scan \-clear \-header; show all \-show pr \-f) | lpr
68
69produces a scan listing of the current folder, followed by a formfeed,
70followed by a formatted listing of all messages in the folder, one per
71page. Omitting `\-show\ pr\ \-f' will cause the messages to be concatenated,
72separated by a one\-line header and two blank lines.
73
74If \fIscan\fR encounters a message without a \*(lqDate:\*(rq field,
75rather than leaving that portion of the scan listing blank,
76the date is filled\-in with the last write date of the message,
77and post\-fixed with a `*'.
78This is particularly handy for scanning a \fIdraft folder\fR,
79as message drafts usually aren't allowed to have dates in them.
80
81To override the output format used by \fIscan\fR,
82the `\-format\ string' or `\-format\ file' switches are used.
83This permits individual fields of the scan listing to be extracted with ease.
84The string is simply a format string and the file is simply a format file.
85See \fImh\-format\fR\0(5) for the details.
86
ad787160
C
87In 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
93body string the (compressed) first part of the body
94dtimenow date the current date
95folder string the name of the current folder
29a3a89d
C
96.re
97.fi
98
ad787160
C
99Also, if no date header was present in the message, the \fIfunction\fR
100escapes which operate on {\fIdate\fP\|} will return values for the
101date 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,
104so 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
115inc(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
127If a folder is given, it will become the current folder.
128.Hi
129Prior to using the format string mechanism,
130`\-header' used to generate a heading saying what each column in the listing
131was.
132Format strings prevent this from happening.
133.Bu
134The argument to the `\-format' switch must be interpreted as a single token
135by the shell that invokes \fIscan\fR.
136Therefore,
137one must usually place the argument to this switch inside double\-quotes.
ad787160
C
138.br
139The value of
140each \fIcomponent\fR escape is set by \fIscan\fR to the contents
141of the first message header \fIscan\fR encounters
142with the corresponding component name;
143any following headers with the same component name are ignored.
144.sp
145The switch `\-reverse', makes \fIscan\fR list the messages
146in reverse order; this should be considered a bug.
147.sp
148The `\-file filename' switch allows the user to obtain a \fIscan\fP
149listing of a maildrop file as produced by \fIpackf\fP. This listing
150includes every message in the file. The user should use \fImsh\fP
151for more selective processing of the file. `\-reverse' is ignored
152with this option.
29a3a89d 153.En