Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / conf / doc / RCS / pick.rf,v
1 head    1.9;
2 access;
3 symbols;
4 locks; strict;
5
6
7 1.9
8 date    92.10.27.00.03.47;      author jromine; state Exp;
9 branches;
10 next    1.8;
11
12 1.8
13 date    92.02.12.00.23.24;      author jromine; state Exp;
14 branches;
15 next    1.7;
16
17 1.7
18 date    92.02.04.00.50.57;      author jromine; state Exp;
19 branches;
20 next    1.6;
21
22 1.6
23 date    90.12.18.14.57.30;      author mh;      state Exp;
24 branches;
25 next    1.5;
26
27 1.5
28 date    90.04.05.15.14.01;      author sources; state Exp;
29 branches;
30 next    1.4;
31
32 1.4
33 date    90.03.22.11.31.33;      author sources; state Exp;
34 branches;
35 next    1.3;
36
37 1.3
38 date    90.03.20.19.42.13;      author sources; state Exp;
39 branches;
40 next    1.2;
41
42 1.2
43 date    90.03.20.17.36.30;      author sources; state Exp;
44 branches;
45 next    1.1;
46
47 1.1
48 date    90.03.20.17.21.14;      author sources; state Exp;
49 branches;
50 next    ;
51
52
53 desc
54 @@
55
56
57 1.9
58 log
59 @document [a-z] decificiency
60 @
61 text
62 @.\"    @@(MHWARNING)
63 .\" @@(#)$Id: pick.rf,v 1.8 1992/02/12 00:23:24 jromine Exp jromine $
64 .SC PICK 1
65 .NA
66 pick \- select messages by content
67 .SY
68 .ie t \{\
69 .ta .4i 1.8i
70 .nf
71 .in .5i
72 ^pick~^^\0\-cc~^ \%[+folder] \%[msgs] \%[\-help]
73 ^^^\0\-date~^ \%[\-before\ date] \%[\-after\ date] \%[\-datefield\ field]
74 ^^^\0\-from~^
75 ^^^\s+2\b'\(lt\(bv\(bv\(lk\(bv\(bv\(lb'\s0\-search~\s+2\b'\(rt\(bv\(bv\(rk\(bv\(bv\(rb'\s0^ pattern \%[\-and\ ...] \%[\-or\ ...] \%[\-not\ ...] \%[\-lbrace\ ...\ \-rbrace]
76 ^^^\0\-subject~^
77 ^^^\0\-to~^ \%[\-sequence\ name\ ...] \%[\-public] \%[\-nopublic] \%[\-zero] \%[\-nozero]
78 ^^^\0\-\|\-component~^ \%[\-list] \%[\-nolist]
79 .fi
80 .re
81 .in 1i
82 .\}
83 .el \{\
84 .ti .5i
85 pick
86 \%[+folder] \%[msgs]
87 \%[\-and\ ...] \%[\-or\ ...] \%[\-not\ ...] \%[\-lbrace\ ...\ \-rbrace]
88 \%[\-\|\-component\ pattern]
89 \%[\-cc\ pattern]
90 \%[\-date\ pattern]
91 \%[\-from\ pattern]
92 \%[\-search\ pattern]
93 \%[\-subject\ pattern]
94 \%[\-to\ pattern]
95 \%[\-after\ date] \%[\-before\ date] \%[\-datefield\ field]
96 \%[\-sequence\ name\ ...]
97 \%[\-public] \%[\-nopublic]
98 \%[\-zero] \%[\-nozero]
99 \%[\-list] \%[\-nolist]
100 \%[\-help]
101 .\}
102
103 .ti .5i
104 typically:
105 .br
106 scan\0`pick\0\-from\0jones`
107 .br
108 pick\0\-to\0holloway\0\-sequence\0select
109 .br
110 show\0`pick\0\-before\0friday`
111 .DE
112 \fIPick\fR searches messages within a folder for the specified
113 contents, and then identifies those messages.
114 Two types of search primitives are available:
115 pattern matching and date constraint operations.
116
117 A modified \fIgrep\fR(1) is used to perform the matching, so the
118 full regular expression (see \fIed\fR(1)) facility is available
119 within `pattern'.
120 With `\-search', `pattern' is used directly,
121 and with the others, the grep pattern constructed is:
122
123 .ti +.5i
124 \*(lqcomponent[ \\t]*:\&.*pattern\*(rq
125
126 This means that the pattern specified for a `\-search' will be
127 found everywhere in the message, including the header and the body,
128 while the other pattern matching requests are limited to the single
129 specified component.
130 The expression
131
132 .ti +.5i
133 `\-\|\-component\ pattern'
134
135 is a shorthand for specifying
136
137 .ti +.5i
138 `\-search \*(lqcomponent[ \\t]*:\&.*pattern\*(rq\ '
139
140 It is used to pick a component which is not one of
141 \*(lqTo:\*(rq, \*(lqcc:\*(rq, \*(lqDate:\*(rq, \*(lqFrom:\*(rq,
142 or \*(lqSubject:\*(rq.
143 An example is `pick\0\-\|\-reply\-to\0pooh'.
144
145 Pattern matching is performed on a per\-line basis.
146 Within the header of
147 the message, each component is treated as one long line, but in
148 the body, each line is separate.
149 Lower\-case letters in the
150 search pattern will match either lower or upper case in the
151 message, while upper case will match only upper case.
152
153 Note that since the `\-date' switch is a pattern matching operation (as 
154 described above),
155 to find messages sent on a certain date
156 the pattern string must match the text of the
157 \*(lqDate:\*(rq field of the message.
158
159 Independent of any pattern matching operations requested,
160 the switches `\-after date' or `\-before date' may also be used
161 to introduce date/time contraints on all of the messages.
162 By default, the \*(lqDate:\*(rq field is consulted,
163 but if another date yielding field
164 (such as \*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq) should be used,
165 the `\-datefield\ field' switch may be used.
166
167 With `\-before' and `\-after',
168 \fIpick\fR will actually parse the date fields in each of the messages
169 specified in `msgs'
170 and compare them to the date/time specified.
171 If `\-after' is given,
172 then only those messages whose \*(lqDate:\*(rq field value
173 is chronologically after
174 the date specified will be considered.
175 The `\-before' switch specifies the complimentary action.
176
177 Both the `\-after' and `\-before' switches take legal 822\-style date
178 specifications as arguments.
179 \fIPick\fR will default certain missing fields so that the entire date
180 need not be specified.
181 These fields are (in order of defaulting):
182 timezone, time and timezone, date, date and timezone.
183 All defaults are taken from the current date, time, and timezone.
184
185 In addition to 822\-style dates,
186 \fIpick\fR will also recognize any of the days of the week
187 (\*(lqsunday\*(rq, \*(lqmonday\*(rq, and so on),
188 and the special dates
189 \*(lqtoday\*(rq, \*(lqyesterday\*(rq (24 hours ago),
190 and \*(lqtomorrow\*(rq (24 hours from now).
191 All days of the week are judged to refer to a day in the past
192 (e.g., telling \fIpick\fR \*(lqsaturday\*(rq on
193 a \*(lqtuesday\*(rq means \*(lqlast\ saturday\*(rq
194 not \*(lqthis\ saturday\*(rq).
195
196 Finally, in addition to these special specifications,
197 \fIpick\fR will also honor a specification of the form \*(lq\-dd\*(rq,
198 which means \*(lqdd days ago\*(rq.
199
200 \fIPick\fR supports complex boolean operations on the searching primitives
201 with the `\-and', `\-or', `\-not', and `\-lbrace\ ...\ \-rbrace' switches.
202 For example,
203
204 .ti +.5i
205 .ie t \{\
206 pick\0\-after\0yesterday\0\-and\0\-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
207 .\}
208 .el \{\
209 pick\0\-after\0yesterday\0\-and
210 .br
211 .ti +1i
212 \-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
213 .\}
214
215 identifies messages recently sent by \*(lqfrieda\*(rq or \*(lqfear\*(rq.
216
217 The matching primitives take precedence over the `\-not' switch,
218 which in turn takes precedence over `\-and'
219 which in turn takes precedence over `\-or'.
220 To override the default precedence,
221 the `\-lbrace' and `\-rbrace' switches are provided,
222 which act just like opening and closing parentheses in logical expressions.
223
224 If no search criteria are given, all the messages
225 specified on the command
226 line are selected (this defaults to \*(lqall\*(rq).
227
228 Once the search has been performed,
229 if the `\-list' switch is given,
230 the message numbers of the selected messages are written to the standard
231 output separated by newlines.
232 This is \fIextremely\fR useful for quickly generating arguments for other
233 \fIMH\fR programs by using the \*(lqbackquoting\*(rq syntax of the shell.
234 For example,
235 the command
236
237 .ti +.5i
238 scan\0`pick\0+todo\0\-after\0\*(lq31 Mar 83 0123 PST\*(rq`
239
240 says to \fIscan\fR those messages in the indicated folder which meet the
241 appropriate criterion.
242 Note that since \fIpick\fR\0's context changes are written out prior to
243 \fIscan\fR\0's invocation,
244 you need not give the folder argument to \fIscan\fR as well.
245
246 Regardless of the operation of the `\-list' switch,
247 the `\-sequence name' switch may be given once for each sequence the user
248 wishes to define.
249 For each sequence named,
250 that sequence will be defined to mean exactly those messages selected by
251 \fIpick\fR.
252 For example,
253
254 .ti +.5i
255 pick\0\-from\0frated\0\-seq\0fred
256
257 defines a new message sequence for the current folder called \*(lqfred\*(rq
258 which contains exactly those messages that were selected.
259
260 Note that whenever \fIpick\fR processes a `\-sequence\ name' switch,
261 it sets `\-nolist'.
262
263 By default, \fIpick\fR will zero the sequence before adding it.
264 This action can be disabled with the `\-nozero' switch,
265 which means that the messages selected by \fIpick\fR will be added to the
266 sequence, if it already exists, and any messages already a part of that
267 sequence will remain so.
268
269 The `\-public' and `\-nopublic' switches are used by \fIpick\fR in the same
270 way \fImark\fR uses them.
271 .Fi
272 ^$HOME/\&.mh\(ruprofile~^The user profile
273 .Pr
274 ^Path:~^To determine the user's MH directory
275 .Ps
276 ^Current\-Folder:~^To find the default current folder
277 .Sa
278 mark(1)
279 .De
280 `+folder' defaults to the current folder
281 .Ds
282 `msgs' defaults to all
283 .Ds
284 `\-datefield date'
285 .Ds
286 `\-nopublic' if the folder is read\-only, `\-public' otherwise
287 .Ds
288 `\-zero'
289 .Ds
290 `\-list' is the default if no `\-sequence', `\-nolist' otherwise
291 .Co
292 If a folder is given, it will become the current folder.
293 .Hi
294 In previous versions of \fIMH\fR,
295 the \fIpick\fR command would \fIshow\fR, \fIscan\fR, or \fIrefile\fR the
296 selected messages.
297 This was rather \*(lqinverted logic\*(rq from the UNIX point of view,
298 so \fIpick\fR was changed to define sequences and output those sequences.
299 Hence, \fIpick\fR can be used to generate the arguments for all other
300 \fIMH\fR commands,
301 instead of giving \fIpick\fR endless switches for invoking those commands
302 itself.
303
304 Also, previous versions of \fIpick\fR balked if you didn't specify a search
305 string or a date/time constraint.
306 The current version does not, and merely matches the messages you specify.
307 This lets you type something like:
308
309 .ti +.5i
310 show\0`pick\0last:20\0\-seq\0fear`
311
312 instead of typing
313
314 .in +.5i
315 .nf
316 mark\0\-add\0\-nozero\0\-seq\0fear\0last:20
317 show\0fear
318 .fi
319 .in -.5i
320
321 Finally,
322 timezones used to be ignored when comparing dates:
323 they aren't any more.
324 .Hh
325 Use \*(lqpick sequence \-list\*(rq
326 to enumerate the messages in a sequence (such as for use 
327 by a shell script).
328 .Bu
329 The argument to the `\-after' and `\-before' switches must be interpreted
330 as a single token by the shell that invokes \fIpick\fR.
331 Therefore,
332 one must usually place the argument to this switch inside double\-quotes.
333 Furthermore,
334 any occurance of `\-datefield' must occur prior to the `\-after'
335 or `\-before' switch it applies to.
336
337 If \fIpick\fR is used in a back\-quoted operation,
338 such as
339
340 .ti +.5i
341 scan\0`pick\0\-from\0jones`
342
343 and \fIpick\fR selects no messages
344 (e.g., no messages are from \*(lqjones\*(rq),
345 then the shell will still run the outer command (e.g., \*(lqscan\*(rq).
346 Since no messages were matched,
347 \fIpick\fR produced no output,
348 and the argument given to the outer command as a result of backquoting
349 \fIpick\fR is empty.
350 In the case of \fIMH\fR programs,
351 the outer command now acts as if the default `msg' or `msgs' should be used
352 (e.g., \*(lqall\*(rq in the case of \fIscan\fR\0).
353 To prevent this unexpected behavior,
354 if `\-list' was given,
355 and if its standard output is not a tty,
356 then \fIpick\fR outputs the illegal message number \*(lq0\*(rq when it fails.
357 This lets the outer command fail gracefully as well.
358 .sp
359 The pattern syntax \*(lq[l-r]\*(rq is not supported; each letter
360 to be matched must be included within the square brackets.
361 .En
362 @
363
364
365 1.8
366 log
367 @reformat
368 add hints
369 @
370 text
371 @d2 1
372 a2 1
373 .\" @@(#)$Id: pick.rf,v 1.7 1992/02/04 00:50:57 jromine Exp jromine $
374 d263 4
375 d297 3
376 a299 4
377 .Hh
378 Use \*(lqpick sequence \-list\*(rq
379 to enumerate the messages in a sequence (such as for use 
380 by a shell script).
381 @
382
383
384 1.7
385 log
386 @add -cc/date/from/...
387 nroff man page didn't include them.
388 @
389 text
390 @d2 1
391 a2 1
392 .\" @@(#)$Id: pick.rf,v 1.6 90/12/18 14:57:30 mh Exp $
393 d144 1
394 d146 7
395 d163 4
396 d278 2
397 a279 1
398 and \fIpick\fR fails (e.g., no messages are from \*(lqjones\*(rq),
399 d293 4
400 @
401
402
403 1.6
404 log
405 @clean up formatting.  describe '-date' better
406 jlr
407 @
408 text
409 @d2 1
410 a2 1
411 .\" @@(#)$Id: pick.rf,v 1.5 90/04/05 15:14:01 sources Exp Locker: mh $
412 d28 6
413 @
414
415
416 1.5
417 log
418 @add ID
419 @
420 text
421 @d2 1
422 a2 1
423 .\" @@(#)$Id:$
424 d86 6
425 d99 3
426 a101 1
427 \fIPick\fR will actually parse the date fields in each of the messages
428 d103 1
429 a103 4
430 (unlike the `\-date' switch described above which does a pattern matching
431 operation),
432 and compare them to the date/time specified by use of the `\-after'
433 and `\-before' switches.
434 d117 1
435 d122 2
436 a123 1
437 \*(lqtoday\*(rq, \*(lqyesterday\*(rq, and \*(lqtomorrow\*(rq.
438 d128 1
439 @
440
441
442 1.4
443 log
444 @put things back, do .NA stuff another way
445 @
446 text
447 @d2 1
448 @
449
450
451 1.3
452 log
453 @typo
454 @
455 text
456 @d2 2
457 a3 2
458 .TH PICK 1 @@(MHCENTERFOOT) @@(MHLEFTFOOT)
459 .SH .NA
460 d5 1
461 a5 1
462 .SH .SY
463 @
464
465
466 1.2
467 log
468 @fixup for makewhatis
469 @
470 text
471 @d2 1
472 a2 1
473 .TH PICK 1 [mh.6] MH
474 @
475
476
477 1.1
478 log
479 @Initial revision
480 @
481 text
482 @d2 2
483 a3 2
484 .SC PICK 1
485 .NA
486 d5 1
487 a5 1
488 .SY
489 @