8 date 92.10.27.00.03.47; author jromine; state Exp;
13 date 92.02.12.00.23.24; author jromine; state Exp;
18 date 92.02.04.00.50.57; author jromine; state Exp;
23 date 90.12.18.14.57.30; author mh; state Exp;
28 date 90.04.05.15.14.01; author sources; state Exp;
33 date 90.03.22.11.31.33; author sources; state Exp;
38 date 90.03.20.19.42.13; author sources; state Exp;
43 date 90.03.20.17.36.30; author sources; state Exp;
48 date 90.03.20.17.21.14; author sources; state Exp;
59 @document [a-z] decificiency
63 .\" @@(#)$Id: pick.rf,v 1.8 1992/02/12 00:23:24 jromine Exp jromine $
66 pick \- select messages by content
72 ^pick~^^\0\-cc~^ \%[+folder] \%[msgs] \%[\-help]
73 ^^^\0\-date~^ \%[\-before\ date] \%[\-after\ date] \%[\-datefield\ field]
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]
77 ^^^\0\-to~^ \%[\-sequence\ name\ ...] \%[\-public] \%[\-nopublic] \%[\-zero] \%[\-nozero]
78 ^^^\0\-\|\-component~^ \%[\-list] \%[\-nolist]
87 \%[\-and\ ...] \%[\-or\ ...] \%[\-not\ ...] \%[\-lbrace\ ...\ \-rbrace]
88 \%[\-\|\-component\ pattern]
93 \%[\-subject\ pattern]
95 \%[\-after\ date] \%[\-before\ date] \%[\-datefield\ field]
96 \%[\-sequence\ name\ ...]
97 \%[\-public] \%[\-nopublic]
98 \%[\-zero] \%[\-nozero]
99 \%[\-list] \%[\-nolist]
106 scan\0`pick\0\-from\0jones`
108 pick\0\-to\0holloway\0\-sequence\0select
110 show\0`pick\0\-before\0friday`
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.
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
120 With `\-search', `pattern' is used directly,
121 and with the others, the grep pattern constructed is:
124 \*(lqcomponent[ \\t]*:\&.*pattern\*(rq
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
133 `\-\|\-component\ pattern'
135 is a shorthand for specifying
138 `\-search \*(lqcomponent[ \\t]*:\&.*pattern\*(rq\ '
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'.
145 Pattern matching is performed on a per\-line basis.
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.
153 Note that since the `\-date' switch is a pattern matching operation (as
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.
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.
167 With `\-before' and `\-after',
168 \fIpick\fR will actually parse the date fields in each of the messages
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.
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.
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).
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.
200 \fIPick\fR supports complex boolean operations on the searching primitives
201 with the `\-and', `\-or', `\-not', and `\-lbrace\ ...\ \-rbrace' switches.
206 pick\0\-after\0yesterday\0\-and\0\-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
209 pick\0\-after\0yesterday\0\-and
212 \-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
215 identifies messages recently sent by \*(lqfrieda\*(rq or \*(lqfear\*(rq.
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.
224 If no search criteria are given, all the messages
225 specified on the command
226 line are selected (this defaults to \*(lqall\*(rq).
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.
238 scan\0`pick\0+todo\0\-after\0\*(lq31 Mar 83 0123 PST\*(rq`
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.
246 Regardless of the operation of the `\-list' switch,
247 the `\-sequence name' switch may be given once for each sequence the user
249 For each sequence named,
250 that sequence will be defined to mean exactly those messages selected by
255 pick\0\-from\0frated\0\-seq\0fred
257 defines a new message sequence for the current folder called \*(lqfred\*(rq
258 which contains exactly those messages that were selected.
260 Note that whenever \fIpick\fR processes a `\-sequence\ name' switch,
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.
269 The `\-public' and `\-nopublic' switches are used by \fIpick\fR in the same
270 way \fImark\fR uses them.
272 ^$HOME/\&.mh\(ruprofile~^The user profile
274 ^Path:~^To determine the user's MH directory
276 ^Current\-Folder:~^To find the default current folder
280 `+folder' defaults to the current folder
282 `msgs' defaults to all
286 `\-nopublic' if the folder is read\-only, `\-public' otherwise
290 `\-list' is the default if no `\-sequence', `\-nolist' otherwise
292 If a folder is given, it will become the current folder.
294 In previous versions of \fIMH\fR,
295 the \fIpick\fR command would \fIshow\fR, \fIscan\fR, or \fIrefile\fR the
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
301 instead of giving \fIpick\fR endless switches for invoking those commands
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:
310 show\0`pick\0last:20\0\-seq\0fear`
316 mark\0\-add\0\-nozero\0\-seq\0fear\0last:20
322 timezones used to be ignored when comparing dates:
323 they aren't any more.
325 Use \*(lqpick sequence \-list\*(rq
326 to enumerate the messages in a sequence (such as for use
329 The argument to the `\-after' and `\-before' switches must be interpreted
330 as a single token by the shell that invokes \fIpick\fR.
332 one must usually place the argument to this switch inside double\-quotes.
334 any occurance of `\-datefield' must occur prior to the `\-after'
335 or `\-before' switch it applies to.
337 If \fIpick\fR is used in a back\-quoted operation,
341 scan\0`pick\0\-from\0jones`
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
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.
359 The pattern syntax \*(lq[l-r]\*(rq is not supported; each letter
360 to be matched must be included within the square brackets.
373 .\" @@(#)$Id: pick.rf,v 1.7 1992/02/04 00:50:57 jromine Exp jromine $
378 Use \*(lqpick sequence \-list\*(rq
379 to enumerate the messages in a sequence (such as for use
386 @add -cc/date/from/...
387 nroff man page didn't include them.
392 .\" @@(#)$Id: pick.rf,v 1.6 90/12/18 14:57:30 mh Exp $
398 and \fIpick\fR fails (e.g., no messages are from \*(lqjones\*(rq),
405 @clean up formatting. describe '-date' better
411 .\" @@(#)$Id: pick.rf,v 1.5 90/04/05 15:14:01 sources Exp Locker: mh $
427 \fIPick\fR will actually parse the date fields in each of the messages
430 (unlike the `\-date' switch described above which does a pattern matching
432 and compare them to the date/time specified by use of the `\-after'
433 and `\-before' switches.
437 \*(lqtoday\*(rq, \*(lqyesterday\*(rq, and \*(lqtomorrow\*(rq.
444 @put things back, do .NA stuff another way
458 .TH PICK 1 @@(MHCENTERFOOT) @@(MHLEFTFOOT)
468 @fixup for makewhatis