]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/man/pick.1
Replaced use of snprintf() with memcpy()/memmove().
[nmh] / docs / historical / mh-jun-1982 / man / pick.1
1 .TH PICK 1 RAND
2 .SH NAME
3 pick \- select messages by content
4 .SH SYNOPSIS
5 .B pick
6 \-hdr-component pattern
7 \%[\fB\-src\fR\ +folder] \%[msgs] \%[\fB\-help\fR]
8 \%[\fB\-scan\fR] \%[\fB\-noscan\fR]
9 \%[\fB\-show\fR] \%[\fB\-noshow\fR] \%[\fB\-nofile\fR] \%[\fB\-nokeep\fR]
10 \%[\fB\-fil\fRe \%[\fB\-preserve\fR] \%[\fB\-link\fR]
11 \%+folder\ ... \%[\fB\-nopreserve\fR] \%[\fB\-nolink\fR] ]
12 \%[\fB\-keep\fR \%[\fB\-stay\fR] \%[\fB\-nostay\fR] \%[+folder\ ...]\ ]
13 .br
14
15 Where
16 .I hdr-component
17 is a member of
18 .br
19 [\fBcc date from to subject search\fR],
20 .br
21 or
22 is of the form \-text
23 .PP
24 Typically:
25 .in 1i
26 pick\0\-from\0jones\0\-scan
27 .br
28 pick\0\-search\0documentation
29 .br
30 pick\0\-subject\0ned\0\-scan\0\-keep
31 .br
32 pick\0\--expires\01-jan-85\0-scan
33 .SH DESCRIPTION
34 \fIPick\fR searches messages within a folder for the specified
35 contents, then performs several operations on the selected
36 messages.
37
38 A modified \fIgrep\fR(1) is used to perform the searching, so the
39 full regular expression (see \fIed\fR(1)) facility is available
40 within `pattern'.
41 With `\-search',
42 .I pattern
43 is used directly,
44 and with the others, the grep pattern constructed is:
45
46 .ti +.5i
47 ``hdr-component:\*.\*(**pattern''
48
49 This means that the pattern specified for a `\-search' will be
50 found everywhere in the message, including the header and the body,
51 while the other search requests are limited to the single
52 specified component.
53 The expression `\-\-component pattern'
54 is a shorthand for
55 specifying `\-search ``component:\*.\*(**pattern''\ '; it is used to pick
56 a component not in the set [cc date from subject to].
57 An
58 example is ``pick \-\-reply\-to pooh \-show''.
59
60 Searching is performed on a per-line basis.
61 Within the header of
62 the message, each component is treated as one long line, but in
63 the body, each line is separate.
64 Lower-case letters in the
65 search pattern will match either lower or upper case in the
66 message, while upper case will match only upper case.
67
68 Once the search has been performed, the selected messages
69 are scanned (see \fIscan(1)\fR) if the `\-scan' switch is given, and
70 then they are shown (see \fIshow(1)\fR) if the `\-show' switch is
71 given.
72 After these two operations, the file operations (if
73 requested) are performed.
74
75 The `\-file' switch operates exactly like the \fIfile\fR command, with the
76 same meaning for the `\-preserve' and `\-link' switches.
77
78 The `\-keep' switch is similar to `\-file', but it produces a folder that
79 is a subfolder of the folder being searched and defines it as
80 the current folder (unless the `\-stay' flag is used).
81 This
82 subfolder contains the messages which matched the search
83 criteria.
84 All of the MH commands may be used with the sub-folder
85 as the current folder.
86 This gives the user considerable power
87 in dealing with subsets of messages in a folder.
88
89 The messages in a folder produced by `\-keep' will always have the
90 same numbers as they have in the source folder (i.e., the
91 `\-preserve' switch is automatic).
92 This way, the message
93 numbers are consistent with the folder from which the messages
94 were selected.
95 Messages are not removed from the source folder
96 (i.e., the `\-link' switch is assumed).
97 If a `+folder' is not
98 specified, the standard name ``select'' will be used.
99 (This is the
100 meaning of ``(select)'' when it appears in the output of the
101 \fIfolder\fR command.) If `+folder' arguments are given to
102 `\-keep', they will be used rather than ``select'' for the names
103 of the subfolders.
104 This allows for several subfolders to be
105 maintained concurrently.
106
107 When a `\-keep' is performed, the subfolder becomes the current folder.
108 This can be overridden by use
109 of the `\-stay' switch.
110
111 Here's an example:
112
113 .nf
114 \01 % folder +inbox
115 \02 inbox+ has 16 messages ( 3\- 22); cur= 3.
116 \03 % pick \-from dcrocker
117 \04 6 hits.
118 \05 [+inbox/select now current]
119 \06 % folder
120 \07 inbox/select+ has \06 messages ( 3\- 16); cur= 3.
121 \08 % scan
122 .ds p \\h'\\w'+'u'
123 \09 \03+ 6/20 Dcrocker Re: ned file update issue...
124 10 \06\*p 6/23 Dcrocker removal of files from /tm...
125 11 \08\*p 6/27 Dcrocker Problems with the new ned...
126 12 13\*p 6/28 d\h'\w'D'u-\w'd'u'crocker newest nned \*(<<I would ap...
127 13 15\*p 7/\05 Dcrocker nned \*(<<Last week I asked...
128 14 16\*p 7/\05 d\h'\w'D'u-\w'd'u'crocker message id format \*(<<I re...
129 15 % show all | print
130 16 [produce a full listing of this set of messages on the line printer.]
131 17 % folder \-up
132 18 inbox+ has 16 messages ( 3\- 22); cur= 3; (select).
133 19 % folder \-down
134 20 inbox/select+ has 6 messages ( 3\- 16); cur= 3.
135 21 % rmf
136 22 [+inbox now current]
137 23 % folder
138 24 inbox+ has 16 messages ( 3\- 22); cur= 3.
139 .fi
140
141 This is a rather lengthy example, but it shows the power of the
142 MH package.
143 In item 1, the current folder is set to inbox.
144 In 3,
145 all of the messages from dcrocker are found in inbox and linked
146 into the folder ``inbox/select''.
147 (Since no action switch is
148 specified, `\-keep' is assumed.) Items 6 and 7 show that this
149 subfolder is now the current folder.
150 Items 8 through 14 are a
151 \fIscan\fR of the selected messages (note that they are all from dcrocker
152 and are all in upper and lower case).
153 Item 15 lists all of the messages to
154 the high-speed printer.
155 Item 17 directs \fIfolder\fR to set the
156 current folder to the parent of the selection-list folder, which
157 is now current.
158 Item 18 shows that this has been done.
159 Item 19 resets
160 the current folder to the selection list, and 21 removes the
161 selection-list folder and resets the current folder to the
162 parent folder, as shown in 22 and 23.
163 .SH FILES
164 .ta 2.4i
165 $HOME/\*.mh\(ruprofile The user profile
166 .SH PROFILE COMPONENTS
167 Path: To determine the user's MH directory
168 .br
169 Folder\-Protect: For protection on new folders
170 .br
171 Current-Folder: To find the default current folder
172 .SH SEE ALSO
173 scan(1), show(1), folder(1)
174 .SH DEFAULTS
175 `\-src +folder' defaults to current
176 .br
177 `msgs' defaults to all
178 .br
179 `\-keep +select' is the default if no `\-scan', `\-show', or `\-file' is specified
180 .SH CONTEXT
181 If a `\-src +folder' is specified, it will
182 become the current folder, unless a `\-keep' with 0 or 1
183 folder arguments makes the selection-list subfolder the
184 current folder.
185 Each selection-list folder will have its
186 current message set to the first of the messages linked into
187 it unless the selection list already existed, in which case the
188 current message won't be c