Pick searches within a folder for messages with the specified
contents, and then identifies those messages. Two types of search
primitives are available: pattern matching and date constraint
operations.
A modified grep(1) is used to perform the matching, so the
full regular expression (see ed(1)) facility is available
within `pattern'. With `-search', `pattern' is used directly,
and with the others, the grep pattern constructed is:
\*(lqcomponent[ \\t]*:.*pattern\*(rq
This means that the pattern specified for a `-search' will be found
everywhere in the message, including the header and the body, while
the other pattern matching requests are limited to the single specified
component. The expression
`-\|-component\ pattern'
is a shorthand for specifying
`-search \*(lqcomponent[ \\t]*:.*pattern\*(rq\ '
It is used to pick a component which is not one of \*(lqTo:\*(rq,
\*(lqcc:\*(rq, \*(lqDate:\*(rq, \*(lqFrom:\*(rq, or \*(lqSubject:\*(rq.
An example is `pick\0-\|-reply-to\0pooh'.
Pattern matching is performed on a per-line basis. Within the header
of the message, each component is treated as one long line, but in the
body, each line is separate. Lower-case letters in the search pattern
will match either lower or upper case in the message, while upper case
will match only upper case.
Note that since the `-date' switch is a pattern matching operation (as
described above), to find messages sent on a certain date the pattern
string must match the text of the \*(lqDate:\*(rq field of the message.
Independent of any pattern matching operations requested, the switches
`-after date' or `-before date' may also be used to introduce date/time
constraints on all of the messages. By default, the \*(lqDate:\*(rq
field is consulted, but if another date yielding field (such as
\*(lqBB-Posted:\*(rq or \*(lqDelivery-Date:\*(rq) should be used, the
`-datefield\ field' switch may be used.
With `-before' and `-after', pick will actually parse the date
fields in each of the messages specified in `msgs' and compare them
to the date/time specified. If `-after' is given, then only those
messages whose \*(lqDate:\*(rq field value is chronologically after the
date specified will be considered. The `-before' switch specifies the
complimentary action.
Both the `-after' and `-before' switches take legal 822-style date
specifications as arguments. Pick will default certain missing
fields so that the entire date need not be specified. These fields
are (in order of defaulting): timezone, time and timezone, date, date
and timezone. All defaults are taken from the current date, time,
and timezone.
In addition to 822-style dates, pick will also recognize any of
the days of the week (\*(lqsunday\*(rq, \*(lqmonday\*(rq, and so on),
and the special dates \*(lqtoday\*(rq, \*(lqyesterday\*(rq (24 hours
ago), and \*(lqtomorrow\*(rq (24 hours from now). All days of the
week are judged to refer to a day in the past (e.g., telling pick
\*(lqsaturday\*(rq on a \*(lqtuesday\*(rq means \*(lqlast\ saturday\*(rq
not \*(lqthis\ saturday\*(rq).
Finally, in addition to these special specifications, pick will
also honor a specification of the form \*(lq-dd\*(rq, which means
\*(lqdd days ago\*(rq.
Pick supports complex boolean operations on the searching primitives
with the `-and', `-or', `-not', and `-lbrace\ ...\ -rbrace' switches.
For example,
t \{\
pick\0-after\0yesterday\0-and\0-lbrace\0-from\0freida\0-or\0-from\0fear\0-rbrace