1 .TH PICK %manext1% 2016-03-12 "%nmhversion%"
6 pick \- search nmh messages
50 .RB [ \-public " | " \-nopublic ]
51 .RB [ \-zero " | " \-nozero ]
52 .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 full regular expression (see
76 facility is available within
81 is used directly, and with the others, the grep pattern constructed is:
84 `component[ \\t]*:.*pattern'
87 This means that the pattern specified for a
89 will be found everywhere in the message, including the header and the body,
90 while the other pattern matching requests are limited to the single specified
91 component. The expression
94 `\-\|\-component\ pattern'
97 is a shorthand for specifying
100 `\-search \*(lqcomponent[ \\t]*:.*pattern\*(rq\ '
103 It is used to pick a component which is not one of \*(lqTo:\*(rq,
104 \*(lqcc:\*(rq, \*(lqDate:\*(rq, \*(lqFrom:\*(rq, or \*(lqSubject:\*(rq.
106 .RB \*(lq "pick\0\-\|\-reply\-to\0pooh" \*(rq.
108 Pattern matching is performed on a per-line basis. Within the header
109 of the message, each component is treated as one long line, but in the
110 body, each line is separate. Lower-case letters in the search pattern
111 will match either lower or upper case in the message, while upper case
112 will match only upper case.
116 switch is a pattern matching operation (as described above),
117 to find messages sent on a certain date the pattern string must match
118 the text of the \*(lqDate:\*(rq field of the message.
120 Independent of any pattern matching operations requested, the switches
126 may also be used to introduce date/time constraints on all of the messages.
127 By default, the \*(lqDate:\*(rq field is consulted, but if another
128 date-yielding field (such as \*(lqBB\-Posted:\*(rq or
129 \*(lqDelivery\-Date:\*(rq) should be used, the
139 will actually parse the date fields in each of the messages specified in
140 `msgs' and compare them to the date/time specified. If
142 is given, then only those messages whose \*(lqDate:\*(rq field value is
143 chronologically after the date specified will be considered. The
145 switch specifies the complementary action.
151 switches take legal RFC 822-style date specifications as arguments.
153 will default certain missing fields so that the entire date need not
154 be specified. These fields are (in order of defaulting): timezone,
155 time and timezone, date, date and timezone.
156 All defaults are taken from the current date, time, and timezone.
158 In addition to RFC 822-style dates,
160 will also recognize any of the days of the week (\*(lqsunday\*(rq,
161 \*(lqmonday\*(rq, and so on), and the special dates \*(lqtoday\*(rq,
162 \*(lqyesterday\*(rq (24 hours ago), and \*(lqtomorrow\*(rq
164 All days of the week are judged to refer to a day in the past
165 (e.g., telling \fIpick\fR \*(lqsaturday\*(rq on a \*(lqtuesday\*(rq
166 means \*(lqlast\ saturday\*(rq not \*(lqthis\ saturday\*(rq).
168 Finally, in addition to these special specifications,
170 will also honor a specification of the form \*(lq\-dd\*(rq, which means
171 \*(lqdd days ago\*(rq.
177 find matching messages in reverse order, working from the highest message
178 number down to the lowest. This can be useful in searching for recent
179 messages in large folders, for example,
183 pick\0\-reverse\0\-from\0frated\0|\0xargs\0\-n1\0scan
188 supports complex boolean operations on the searching primitives with the
201 pick\0\-after\0yesterday\0\-and
202 \-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
206 identifies messages recently sent by \*(lqfrieda\*(rq or \*(lqfear\*(rq.
208 The matching primitives take precedence over the
210 switch, which in turn takes precedence over
212 which in turn takes precedence over
214 To override the default precedence, the
218 switches are provided, which act just like opening and closing
219 parentheses in logical expressions.
221 If no search criteria are given, all the messages specified on the
222 command line are selected (this defaults to \*(lqall\*(rq).
224 Once the search has been performed, if the
226 switch is given, the message numbers of the selected messages are
227 written to the standard output separated by newlines. This is
229 useful for quickly generating arguments for other
231 programs by using the \*(lqbackquoting\*(rq syntax of the shell.
232 For example, the command
235 scan\0\`pick\0+todo\0\-after\0\*(lq31 Mar 83 0123 PST\*(rq\`
240 those messages in the indicated folder which meet the appropriate
241 criterion. Note that since
243 context changes are written out prior to
245 invocation, you need not give the folder argument to
252 switch may be given once for each sequence the user wishes to define.
253 For each sequence named, that sequence will be defined to mean exactly
254 those messages selected by
259 pick\0\-from\0frated\0\-seq\0fred
262 defines a new message sequence for the current folder called
263 \*(lqfred\*(rq which contains exactly those messages that were selected.
267 switch will disable all previously named sequences, allowing
268 those established by a profile component to be overridden.
272 will zero a sequence before adding it. This action can be disabled with the
274 switch, which means that the messages selected by
276 will be added to the sequence, if it already exists, and any messages
277 already a part of that sequence will remain so.
291 switch causes pick to output a representation of the search pattern.
292 .SS "Output when no messages are matched"
295 is used in a backquoted operation, such as
298 scan\0\`pick\0\-from\0jones\`
303 selects no messages (e.g., no messages are from \*(lqjones\*(rq),
304 then the shell will still run the outer command (e.g.,
306 Since no messages were matched,
308 produced no output, and the argument given to the outer command as a
309 result of backquoting
311 is empty. In the case of
313 programs, the outer command now acts as if the default `msg' or `msgs'
314 should be used (e.g., \*(lqall\*(rq in the case of
316 To prevent this unexpected behavior, if
318 was given, and if its standard output is not a tty, then
320 outputs the illegal message number \*(lq0\*(rq when it fails.
321 This lets the outer command fail gracefully as well.
325 .ta \w'%nmhetcdir%/ExtraBigFileName 'u
326 ^$HOME/.mh_profile~^The user profile
328 .SH "PROFILE COMPONENTS"
332 .ta \w'ExtraBigProfileName 'u
333 ^Path:~^To determine the user's nmh directory
334 ^Current\-Folder:~^To find the default current folder
340 .RB ` +folder "' defaults to the current folder"
341 .RB ` msgs "' defaults to all"
342 .RB ` "\-datefield date" '
344 .RB ` \-list "' is the default if no `\-sequence', `\-nolist' otherwise"
347 If a folder is given, it will become the current folder.
349 In previous versions of
358 the selected messages. This was rather
359 \*(lqinverted logic\*(rq from the Unix point of view, so
361 was changed to define sequences and output those sequences. Hence,
363 can be used to generate the arguments for all other
365 commands, instead of giving
367 endless switches for invoking those commands
370 Also, previous versions of
372 balked if you didn't specify
373 a search string or a date/time constraint. The current version does
374 not, and merely matches the messages you specify. This lets you type
378 show\0\`pick\0last:20\0\-seq\0fear\`
385 mark\0\-add\0\-nozero\0\-seq\0fear\0last:20
390 Finally, timezones used to be ignored when comparing dates: they aren't
394 .RB \*(lq "pick sequence \-list" \*(rq
395 to enumerate the messages in a sequence
396 (such as for use by a shell script).
400 must occur prior to the
404 switch it applies to.
406 The pattern syntax \*(lq[l-r]\*(rq is not supported; each letter to be
407 matched must be included within the square brackets.