1 .TH PICK %manext1% "August 3, 2014" "%nmhversion%"
6 pick \- search for messages by content
48 .RB [ \-public " | " \-nopublic ]
49 .RB [ \-zero " | " \-nozero ]
50 .RB [ \-list " | " \-nolist ]
59 scan\0`pick\0\-from\0jones`
60 pick\0\-to\0holloway\0\-sequence\0select
61 show\0`pick\0\-before\0friday`
67 searches within a folder for messages with the specified
68 contents, and then identifies those messages. Two types of search
69 primitives are available: pattern matching and date constraint
74 is used to perform the matching, so the
75 full regular expression (see
83 is used directly, and with the others, the grep pattern constructed is:
86 `component[ \\t]*:\&.*pattern'
89 This means that the pattern specified for a
92 everywhere in the message, including the header and the body, while
93 the other pattern matching requests are limited to the single specified
94 component. The expression
97 `\-\|\-component\ pattern'
100 is a shorthand for specifying
103 `\-search \*(lqcomponent[ \\t]*:\&.*pattern\*(rq\ '
106 It is used to pick a component which is not one of \*(lqTo:\*(rq,
107 \*(lqcc:\*(rq, \*(lqDate:\*(rq, \*(lqFrom:\*(rq, or \*(lqSubject:\*(rq.
109 .RB \*(lq "pick\0\-\|\-reply\-to\0pooh" \*(rq.
111 Pattern matching is performed on a per\-line basis. Within the header
112 of the message, each component is treated as one long line, but in the
113 body, each line is separate. Lower\-case letters in the search pattern
114 will match either lower or upper case in the message, while upper case
115 will match only upper case.
119 switch is a pattern matching operation (as
120 described above), to find messages sent on a certain date the pattern
121 string must match the text of the \*(lqDate:\*(rq field of the message.
123 Independent of any pattern matching operations requested, the switches
129 may also be used to introduce date/time
130 constraints on all of the messages. By default, the \*(lqDate:\*(rq
131 field is consulted, but if another date yielding field (such as
132 \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq) should be used, the
142 will actually parse the date
143 fields in each of the messages specified in `msgs' and compare them
144 to the date/time specified. If
146 is given, then only those
147 messages whose \*(lqDate:\*(rq field value is chronologically after the
148 date specified will be considered. The
151 complimentary action.
157 switches take legal RFC 822\-style date
158 specifications as arguments.
160 will default certain missing
161 fields so that the entire date need not be specified. These fields
162 are (in order of defaulting): timezone, time and timezone, date, date
163 and timezone. All defaults are taken from the current date, time,
166 In addition to RFC 822\-style dates,
168 will also recognize any of
169 the days of the week (\*(lqsunday\*(rq, \*(lqmonday\*(rq, and so on),
170 and the special dates \*(lqtoday\*(rq, \*(lqyesterday\*(rq (24 hours
171 ago), and \*(lqtomorrow\*(rq (24 hours from now). All days of the
172 week are judged to refer to a day in the past (e.g., telling \fIpick\fR
173 \*(lqsaturday\*(rq on a \*(lqtuesday\*(rq means \*(lqlast\ saturday\*(rq
174 not \*(lqthis\ saturday\*(rq).
176 Finally, in addition to these special specifications,
179 also honor a specification of the form \*(lq\-dd\*(rq, which means
180 \*(lqdd days ago\*(rq.
186 find matching messages in reverse order, working from the highest message
187 number down to the lowest. This can be useful in for searching recent
188 messages in large folders, for example,
192 pick\0\-reverse\0\-from\0frated\0|\0xargs\0\-n1\0scan
197 supports complex boolean operations on the searching primitives
211 pick\0\-after\0yesterday\0\-and
212 \-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
216 identifies messages recently sent by \*(lqfrieda\*(rq or \*(lqfear\*(rq.
218 The matching primitives take precedence over the
220 switch, which in turn takes precedence over
222 which in turn takes precedence
225 To override the default precedence, the
229 switches are provided, which act just like opening and closing
230 parentheses in logical expressions.
232 If no search criteria are given, all the messages specified on the
233 command line are selected (this defaults to \*(lqall\*(rq).
235 Once the search has been performed, if the
238 message numbers of the selected messages are written to the standard
239 output separated by newlines. This is
242 quickly generating arguments for other
244 programs by using the
245 \*(lqbackquoting\*(rq syntax of the shell. For example, the command
248 scan\0`pick\0+todo\0\-after\0\*(lq31 Mar 83 0123 PST\*(rq`
253 those messages in the indicated folder which meet the
254 appropriate criterion. Note that since
257 are written out prior to
259 invocation, you need not give
260 the folder argument to
267 switch may be given once for each sequence the user wishes to define.
268 For each sequence named, that sequence will be defined to mean exactly
269 those messages selected by
274 pick\0\-from\0frated\0\-seq\0fred
277 defines a new message sequence for the current folder called
278 \*(lqfred\*(rq which contains exactly those messages that were selected.
282 switch will disable all previously named sequences, allowing
283 those established by a profile component to be overridden.
287 will zero a sequence before adding it. This
288 action can be disabled with the
290 switch, which means that the
293 will be added to the sequence, if it
294 already exists, and any messages already a part of that sequence will
310 switch causes pick to output a representation of the search
312 .SS "Output when no messages are matched"
315 is used in a backquoted operation, such as
318 scan\0`pick\0\-from\0jones`
323 selects no messages (e.g., no messages are from
324 \*(lqjones\*(rq), then the shell will still run the outer command (e.g.,
326 Since no messages were matched,
329 no output, and the argument given to the outer command as a result of
332 is empty. In the case of
335 the outer command now acts as if the default `msg' or `msgs' should be
336 used (e.g., \*(lqall\*(rq in the case of
339 unexpected behavior, if
341 was given, and if its standard output is not a tty, then
343 outputs the illegal message number \*(lq0\*(rq
344 when it fails. This lets the outer command fail gracefully as well.
348 .ta \w'%nmhetcdir%/ExtraBigFileName 'u
349 ^$HOME/\&.mh\(ruprofile~^The user profile
351 .SH "PROFILE COMPONENTS"
355 .ta \w'ExtraBigProfileName 'u
356 ^Path:~^To determine the user's nmh directory
357 ^Current\-Folder:~^To find the default current folder
363 .RB ` +folder "' defaults to the current folder"
364 .RB ` msgs "' defaults to all"
365 .RB ` "\-datefield date" '
367 .RB ` \-list "' is the default if no `\-sequence', `\-nolist' otherwise"
370 If a folder is given, it will become the current folder.
372 In previous versions of
381 the selected messages. This was rather
382 \*(lqinverted logic\*(rq from the UNIX point of view, so
384 was changed to define sequences and output those sequences. Hence,
386 can be used to generate the arguments for all other
388 commands, instead of giving
390 endless switches for invoking those commands
393 Also, previous versions of
395 balked if you didn't specify
396 a search string or a date/time constraint. The current version does
397 not, and merely matches the messages you specify. This lets you type
401 show\0`pick\0last:20\0\-seq\0fear`
408 mark\0\-add\0\-nozero\0\-seq\0fear\0last:20
413 Finally, timezones used to be ignored when comparing dates: they aren't
417 .RB \*(lq "pick sequence \-list" \*(rq
418 to enumerate the messages in a sequence
419 (such as for use by a shell script).
423 must occur prior to the
427 switch it applies to.
429 The pattern syntax \*(lq[l-r]\*(rq is not supported; each letter to be
430 matched must be included within the square brackets.