source: trunk/third/nmh/man/pick.man @ 12455

Revision 12455, 9.2 KB checked in by danw, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12454, which included commits to RCS files with non-trunk default branches.
Line 
1.\"
2.\" %nmhwarning%
3.\" $Id: pick.man,v 1.1.1.1 1999-02-07 18:14:21 danw Exp $
4.\"
5.\" include the -mh macro file
6.so %etcdir%/tmac.h
7.\"
8.TH PICK %manext1% MH.6.8 [%nmhversion%]
9.SH NAME
10pick \- search for messages by content
11.SH SYNOPSIS
12.in +.5i
13.ti -.5i
14pick
15\%[+folder] \%[msgs]
16\%[\-and\ ...] \%[\-or\ ...] \%[\-not\ ...]
17.br
18\%[\-lbrace\ ...\ \-rbrace]
19\%[\-\|\-component\ pattern]
20.br
21\%[\-cc\ pattern]
22\%[\-date\ pattern]
23\%[\-from\ pattern]
24.br
25\%[\-search\ pattern]
26\%[\-subject\ pattern]
27\%[\-to\ pattern]
28.br
29\%[\-after\ date]
30\%[\-before\ date]
31\%[\-datefield\ field]
32.br
33\%[\-sequence\ name\ ...]
34\%[\-public] \%[\-nopublic]
35\%[\-zero]
36.br
37\%[\-nozero]
38\%[\-list] \%[\-nolist]
39\%[\-version]
40\%[\-help]
41.ti .5i
42
43typical usage:
44.br
45scan\0`pick\0\-from\0jones`
46.br
47pick\0\-to\0holloway\0\-sequence\0select
48.br
49show\0`pick\0\-before\0friday`
50.in -.5i
51.SH DESCRIPTION
52\fIPick\fR searches within a folder for messages with the specified
53contents, and then identifies those messages.  Two types of search
54primitives are available: pattern matching and date constraint
55operations.
56
57A modified \fIgrep\fR(1) is used to perform the matching, so the
58full regular expression (see \fIed\fR(1)) facility is available
59within `pattern'.  With `\-search', `pattern' is used directly,
60and with the others, the grep pattern constructed is:
61
62.ti +.5i
63\*(lqcomponent[ \\t]*:\&.*pattern\*(rq
64
65This means that the pattern specified for a `\-search' will be found
66everywhere in the message, including the header and the body, while
67the other pattern matching requests are limited to the single specified
68component.  The expression
69
70.ti +.5i
71`\-\|\-component\ pattern'
72
73is a shorthand for specifying
74
75.ti +.5i
76`\-search \*(lqcomponent[ \\t]*:\&.*pattern\*(rq\ '
77
78It is used to pick a component which is not one of \*(lqTo:\*(rq,
79\*(lqcc:\*(rq, \*(lqDate:\*(rq, \*(lqFrom:\*(rq, or \*(lqSubject:\*(rq.
80An example is `pick\0\-\|\-reply\-to\0pooh'.
81
82Pattern matching is performed on a per\-line basis.  Within the header
83of the message, each component is treated as one long line, but in the
84body, each line is separate.  Lower\-case letters in the search pattern
85will match either lower or upper case in the message, while upper case
86will match only upper case.
87
88Note that since the `\-date' switch is a pattern matching operation (as
89described above), to find messages sent on a certain date the pattern
90string must match the text of the \*(lqDate:\*(rq field of the message.
91
92Independent of any pattern matching operations requested, the switches
93`\-after date' or `\-before date' may also be used to introduce date/time
94constraints on all of the messages.  By default, the \*(lqDate:\*(rq
95field is consulted, but if another date yielding field (such as
96\*(lqBB\-Posted:\*(rq or \*(lqDelivery\-Date:\*(rq) should be used, the
97`\-datefield\ field' switch may be used.
98
99With `\-before' and `\-after', \fIpick\fR will actually parse the date
100fields in each of the messages specified in `msgs' and compare them
101to the date/time specified.  If `\-after' is given, then only those
102messages whose \*(lqDate:\*(rq field value is chronologically after the
103date specified will be considered.  The `\-before' switch specifies the
104complimentary action.
105
106Both the `\-after' and `\-before' switches take legal 822\-style date
107specifications as arguments.  \fIPick\fR will default certain missing
108fields so that the entire date need not be specified.  These fields
109are (in order of defaulting): timezone, time and timezone, date, date
110and timezone.  All defaults are taken from the current date, time,
111and timezone.
112
113In addition to 822\-style dates, \fIpick\fR will also recognize any of
114the days of the week (\*(lqsunday\*(rq, \*(lqmonday\*(rq, and so on),
115and the special dates \*(lqtoday\*(rq, \*(lqyesterday\*(rq (24 hours
116ago), and \*(lqtomorrow\*(rq (24 hours from now).  All days of the
117week are judged to refer to a day in the past (e.g., telling \fIpick\fR
118\*(lqsaturday\*(rq on a \*(lqtuesday\*(rq means \*(lqlast\ saturday\*(rq
119not \*(lqthis\ saturday\*(rq).
120
121Finally, in addition to these special specifications, \fIpick\fR will
122also honor a specification of the form \*(lq\-dd\*(rq, which means
123\*(lqdd days ago\*(rq.
124
125\fIPick\fR supports complex boolean operations on the searching primitives
126with the `\-and', `\-or', `\-not', and `\-lbrace\ ...\ \-rbrace' switches.
127For example,
128
129.ti +.5i
130.ie t \{\
131pick\0\-after\0yesterday\0\-and\0\-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
132.\}
133.el \{\
134pick\0\-after\0yesterday\0\-and
135.br
136.ti +1i
137\-lbrace\0\-from\0freida\0\-or\0\-from\0fear\0\-rbrace
138.\}
139
140identifies messages recently sent by \*(lqfrieda\*(rq or \*(lqfear\*(rq.
141
142The matching primitives take precedence over the `\-not' switch, which
143in turn takes precedence over `\-and' which in turn takes precedence
144over `\-or'.  To override the default precedence, the `\-lbrace' and
145`\-rbrace' switches are provided, which act just like opening and closing
146parentheses in logical expressions.
147
148If no search criteria are given, all the messages specified on the
149command line are selected (this defaults to \*(lqall\*(rq).
150
151Once the search has been performed, if the `\-list' switch is given, the
152message numbers of the selected messages are written to the standard
153output separated by newlines.  This is \fIextremely\fR useful for
154quickly generating arguments for other \fInmh\fR programs by using the
155\*(lqbackquoting\*(rq syntax of the shell.  For example, the command
156
157.ti +.5i
158scan\0`pick\0+todo\0\-after\0\*(lq31 Mar 83 0123 PST\*(rq`
159
160says to \fIscan\fR those messages in the indicated folder which meet the
161appropriate criterion.  Note that since \fIpick\fR\0's context changes
162are written out prior to \fIscan\fR\0's invocation, you need not give
163the folder argument to \fIscan\fR as well.
164
165Regardless of the operation of the `\-list' switch, the `\-sequence name'
166switch may be given once for each sequence the user wishes to define.
167For each sequence named, that sequence will be defined to mean exactly
168those messages selected by \fIpick\fR.  For example,
169
170.ti +.5i
171pick\0\-from\0frated\0\-seq\0fred
172
173defines a new message sequence for the current folder called
174\*(lqfred\*(rq which contains exactly those messages that were selected.
175
176Note that whenever \fIpick\fR processes a `\-sequence\ name' switch, it
177sets `\-nolist'.
178
179By default, \fIpick\fR will zero the sequence before adding it.  This
180action can be disabled with the `\-nozero' switch, which means that the
181messages selected by \fIpick\fR will be added to the sequence, if it
182already exists, and any messages already a part of that sequence will
183remain so.
184
185The `\-public' and `\-nopublic' switches are used by \fIpick\fR in the
186same way \fImark\fR uses them.
187.Fi
188^$HOME/\&.mh\(ruprofile~^The user profile
189.Pr
190^Path:~^To determine the user's nmh directory
191.Ps
192^Current\-Folder:~^To find the default current folder
193.Sa
194mark(1)
195.De
196`+folder' defaults to the current folder
197.Ds
198`msgs' defaults to all
199.Ds
200`\-datefield date'
201.Ds
202`\-zero'
203.Ds
204`\-list' is the default if no `\-sequence', `\-nolist' otherwise
205.Co
206If a folder is given, it will become the current folder.
207.Hi
208In previous versions of \fIMH\fR, the \fIpick\fR command would \fIshow\fR,
209\fIscan\fR, or \fIrefile\fR the selected messages.  This was rather
210\*(lqinverted logic\*(rq from the UNIX point of view, so \fIpick\fR was
211changed to define sequences and output those sequences.  Hence, \fIpick\fR
212can be used to generate the arguments for all other \fIMH\fR commands,
213instead of giving \fIpick\fR endless switches for invoking those commands
214itself.
215
216Also, previous versions of \fIpick\fR balked if you didn't specify
217a search string or a date/time constraint.  The current version does
218not, and merely matches the messages you specify.  This lets you type
219something like:
220
221.ti +.5i
222show\0`pick\0last:20\0\-seq\0fear`
223
224instead of typing
225
226.in +.5i
227.nf
228mark\0\-add\0\-nozero\0\-seq\0fear\0last:20
229show\0fear
230.fi
231.in -.5i
232
233Finally, timezones used to be ignored when comparing dates: they aren't
234any more.
235.Hh
236Use \*(lqpick sequence \-list\*(rq to enumerate the messages in a sequence
237(such as for use by a shell script).
238.Bu
239The argument to the `\-after' and `\-before' switches must be interpreted
240as a single token by the shell that invokes \fIpick\fR.  Therefore, one
241must usually place the argument to this switch inside double\-quotes.
242Furthermore, any occurrence of `\-datefield' must occur prior to the
243`\-after' or `\-before' switch it applies to.
244
245If \fIpick\fR is used in a back\-quoted operation, such as
246
247.ti +.5i
248scan\0`pick\0\-from\0jones`
249
250and \fIpick\fR selects no messages (e.g., no messages are from
251\*(lqjones\*(rq), then the shell will still run the outer command (e.g.,
252\*(lqscan\*(rq).  Since no messages were matched, \fIpick\fR produced
253no output, and the argument given to the outer command as a result of
254backquoting \fIpick\fR is empty.  In the case of \fInmh\fR programs,
255the outer command now acts as if the default `msg' or `msgs' should be
256used (e.g., \*(lqall\*(rq in the case of \fIscan\fR\0).  To prevent this
257unexpected behavior, if `\-list' was given, and if its standard output is
258not a tty, then \fIpick\fR outputs the illegal message number \*(lq0\*(rq
259when it fails.  This lets the outer command fail gracefully as well.
260
261.sp
262The pattern syntax \*(lq[l-r]\*(rq is not supported; each letter to be
263matched must be included within the square brackets.
264.En
Note: See TracBrowser for help on using the repository browser.