4 .TH PICK %manext1% "%nmhdate%" MH.6.8 [%nmhversion%]
6 pick \- select messages by content
7 scan \- produce a one line per message scan listing
48 .RI [ +folder ] messages "|" files ]
54 .RB [ \-public " | " \-nopublic ]
55 .RB [ \-zero " | " \-nozero ]
56 .RB [ \-list " | " \-nolist ]
63 .B pick -format scan.default
71 pick\0\-to\0holloway\0\-sequence\0select
72 show\0`pick\0\-before\0friday`
78 searches within a folder for messages with the specified
79 contents, and then identifies those messages. Two types of search
80 primitives are available: pattern matching and date constraint
85 is used to perform the matching, so the
86 full regular expression facility is available
92 is used directly, but only for the body of the Mail.
95 compares the header field name case insensitive
96 and the tries to match the field body with the
101 you can specify the exact header field name you are looking for.
102 It is used to pick a component which is not one of `To:',
103 `Cc:', `Date:', `From:', or `Subject:'.
105 .RB ` "pick\0\-\|\-reply\-to\0pooh" '.
107 Pattern matching is performed on a per\-header-field basis. Within the header
108 of the message, each field is treated as one long line, but in the
109 body, each line is separate. The
115 switch is a pattern matching operation (as
116 described above), to find messages sent on a certain date the pattern
117 string must match the text of the `Date:' field of the message.
119 Independent of any pattern matching operations requested, the switches
125 may also be used to introduce date/time
126 constraints on all of the messages. By default, the `Date:'
127 field is consulted, but if another date yielding field (such as
128 `BB\-Posted:' or `Delivery\-Date:') should be used, the
138 will actually parse the date
139 fields in each of the messages specified in `msgs' and compare them
140 to the date/time specified. If
142 is given, then only those
143 messages whose `Date:' field value is chronologically after the
144 date specified will be considered. The
147 complimentary action.
153 switches take legal 822\-style date
154 specifications as arguments.
156 will default certain missing
157 fields so that the entire date need not be specified. These fields
158 are (in order of defaulting): timezone, time and timezone, date, date
159 and timezone. All defaults are taken from the current date, time,
162 In addition to 822\-style dates,
164 will also recognize any of
165 the days of the week (`sunday', `monday', and so on),
166 and the special dates `today', `yesterday' (24 hours
167 ago), and `tomorrow' (24 hours from now). All days of the
168 week are judged to refer to a day in the past (e.g., telling \fIpick\fR
169 `saturday' on a `tuesday' means `last\ saturday'
170 not `this\ saturday').
171 Further more, dates in a simplified ISO 8601/RFC 3339 style (e.g.
172 `YYYY-MM-DD' or `YYYY-MM-DD hh:mm:ss') are accepted.
173 Finally, in addition to these special specifications,
176 also honor a date specification of the form `\-\fIddd\fR', which means
177 `\fIddd\fR days ago'.
186 identifies the messages of the last thirty days.
189 supports complex boolean operations on the searching primitives
203 pick\0\-after\0yesterday\0\-and
204 \-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
208 identifies messages recently sent by `frieda' or `fear'.
210 The matching primitives take precedence over the
212 switch, which in turn takes precedence over
214 which in turn takes precedence
217 To override the default precedence, the
221 switches are provided, which act just like opening and closing
222 parentheses in logical expressions.
224 If no search criteria are given, all the messages specified on the
225 command line are selected (this defaults to `a').
227 Once the search has been performed, if the
230 message numbers of the selected messages are written to the standard
231 output separated by newlines. This is
234 quickly generating arguments for other
236 programs by using the
237 `backquoting' syntax of the shell. For example, the command
240 show\0`pick\0+todo\0\-after\0`31 Mar 83 0123 PST'`
245 those messages in the indicated folder which meet the
246 appropriate criterion. Note that since
249 are written out prior to
251 invocation, you need not give
252 the folder argument to
259 switch may be given once for each sequence the user wishes to define.
260 For each sequence named, that sequence will be defined to mean exactly
261 those messages selected by
266 pick\0\-from\0frated\0\-seq\0fred
269 defines a new message sequence for the current folder called
270 `fred' which contains exactly those messages that were selected.
274 will zero the sequence before adding it. This
275 action can be disabled with the
277 switch, which means that the
280 will be added to the sequence, if it
281 already exists, and any messages already a part of that sequence will
298 produces a one\-line\-per\-message listing of the specified and selected
300 The default format is for
302 is to print the message number for each message.
305 line contains the message number
306 (name), the date, the `From:' field and the `Subject' field.
307 The following example shows the default output of
312 .ta \w'15+- 'u +\w'07/\|05x 'u +\w'Dcrocker 'u
313 15+ 10/\|05 crocker nned
314 16\- 10/\|05 crocker message id format
315 18 10/\|06 brien Re: Exit status from mkdir
316 19 10/\|07*brien `scan' listing format in mmh
320 The `+' on message 15 indicates that it is the current message.
321 The `\-' on message 16 indicates that it has been replied to, as indicated
322 by a `Replied:' component (produced by the
328 The `*' on message 19 indicates that no `Date:' header was
329 present. The time of last modification of the message is given instead.
331 actually reads each of the specified messages and parses them to extract
332 the desired fields. During parsing, appropriate error messages will be
333 produced if there are format errors in any of the messages.
337 will decode RFC-2047 (MIME) encoding in
340 will only decode these fields if your
341 terminal can natively display the character set used in the encoding.
342 You should set the MM_CHARSET environment variable to your native
343 character set, if it is not US-ASCII. See the mh-profile(5) man
344 page for details about this environment variable.
349 switch allows the user to obtain a
351 listing of a maildrop file as produced by
354 includes every message in the file (you can't scan individual messages).
359 may be used to specify the width of
360 the scan line. The default is to use the width of the terminal.
365 (scan | pr ; show a \-showproc pr) | lpr
368 produces a scan listing of the current folder,
369 followed by a formatted listing of all messages in the folder, one
371 .RB ` "\-showproc\ pr" '
372 will cause the messages to be
373 concatenated, separated by a one\-line header and two blank lines.
375 To override the output format used by
380 switch is used. This permits individual fields of
381 the scan listing to be extracted with ease.
383 is either the name of a format file or a format string directly,
384 if prepended with an equal sign `='.
389 In addition to the standard
393 also recognizes the following additional
399 .ta \w'Dtimenow 'u +\w'Returns 'u
400 .I "Escape Returns Description
401 dtimenow date the current date
402 folder string the name of the current folder
406 If no date header is present in the message, the
411 will return values for the date of last
412 modification of the message file itself. This feature is handy for
413 scanning a draft folder, as message drafts usually aren't allowed
414 to have dates in them.
419 context prior to starting the listing,
420 so interrupting a long
422 listing preserves the new context.
424 purists hate this idea.
429 .ta \w'%etcdir%/ExtraBigFileName 'u
430 ^$HOME/.mmh/profile~^The user profile
433 .SH "PROFILE COMPONENTS"
437 .ta \w'ExtraBigProfileName 'u
438 ^Path:~^To determine the user's mail storage
439 ^Alternate\-Mailboxes:~^To determine the user's mailboxes
440 ^Current\-Folder:~^To find the default current folder
448 .RB ` +folder "' defaults to the current folder"
449 .RB ` msgs "' defaults to all messages"
450 .RB ` "\-datefield date" '
452 .RB ` \-list "' is the default if no `\-sequence', `\-nolist' otherwise"
453 .RB ` "\-format pick\.default" "' if the program is called with scan `scan.default' is used
457 If a folder is given, it will become the current folder.
460 In previous versions of
469 the selected messages. This was rather
470 `inverted logic' from the UNIX point of view, so
472 was changed to define sequences and output those sequences. Hence,
474 can be used to generate the arguments for all other
476 commands, instead of giving
478 endless switches for invoking those commands
481 Also, previous versions of
483 balked if you didn't specify
484 a search string or a date/time constraint. The current version does
485 not, and merely matches the messages you specify. This lets you type
489 show\0`pick\0l:20\0\-seq\0fear`
496 mark\0\-add\0\-nozero\0\-seq\0fear\0l:20
501 Also, timezones used to be ignored when comparing dates: they aren't
510 versions scan and pick where two different tools. So instand of typing
514 scan\0\-from\0philipp
522 scan\0`pick\0\-from\0philipp`
526 With the default config the old style usage is still supported, so
527 you can write scripts for both mmh and nmh.
530 .RB ` "pick sequence \-list" '
531 to enumerate the messages in a sequence
532 (such as for use by a shell script).
537 must occur prior to the
541 switch it applies to.
545 is used in a back\-quoted operation, such as
548 scan\0`pick\0\-from\0jones`
553 selects no messages (e.g., no messages are from
554 `jones'), then the shell will still run the outer command (e.g.,
556 Since no messages were matched,
559 no output, and the argument given to the outer command as a result of
562 is empty. In the case of
565 the outer command now acts as if the default `msg' or `msgs' should be
566 used (e.g., `all' in the case of
569 unexpected behavior, if
571 was given, and if its standard output is not a tty, then
573 outputs the illegal message number `0'
574 when it fails. This lets the outer command fail gracefully as well.
576 To account for this case when combining
578 with regular shell tools, filter out the message number `0'.
582 pick\0...\0|\0fgrep\0-vx\0\&0\0|\0wc\0-l
585 to count the number of messages picked.
587 The pattern syntax `[l-r]' is not supported; each letter to be
588 matched must be included within the square brackets.