source: trunk/athena/bin/discuss/dsgrep/dsgrep.1 @ 25758

Revision 25758, 5.3 KB checked in by jdreed, 12 years ago (diff)
In discuss: * Package discuss server utilities (Trac: #881)
2.\" $Id: dsgrep.1,v 1.5 2001-02-28 20:43:54 ghudson Exp $
4.TH DSGREP 1 "18 Jun 1990"
5.ds ]W MIT Project Athena
7dsgrep \- Search discuss meetings with regular expressions
9dsgrep [-n n_trans] [-e search_regexp] [-f meetings_file]
10[-t trans_num] [-a] [-p] [-v] [-i] [meetingname1 meetingname2 ...]
12.I Dsgrep
13searches discuss meetings for transactions that have titles that match the
14given regular expression, or have contents that match the regular
15expression.  The title of the matching transactions or their contents
16can be printed.
18.I Dsgrep
19understands the following options:
20.TP 12
21.B \-n \fIn_trans\fR
22specifies the number of transactions to look back from the last transaction
23in each discuss meeting specified.  This defaults to 50.  This option is
24ignored when the -t option is specified.
26.B \-e \fIsearch_regexp\fR
27This specifies the regular expression to be matched, in the style of
28.IR egrep (1).
29A detailed explaination of the regular expression format is
30given below.  If this is omitted, it defaults to "*", matching all
33.B \-f \fImeetings_file\fR
34This specifies an alternative meetings file to use as a source of meetings.
35If this option is not specified, it will use the file ${HOME}/.meetings.,
37.B \-t \fItrans_num\fR
38Print out a specific transaction, by number.  When this option is used, the
39-n option is ignored.
41.B \-a
43.I dsgrep
44to search the text of the transactions for the regular expressions as well
45as their titles.
47.B \-p
48Causes the text of the text of the matching transactions to be printed
49instead of just the title.
51.B \-v
52Causes errors getting transactions to be reported.  These errors are usually
53due to deleted transactions in the meetings, and are ususally not worth
56.B \-d
57Causes deleted transactions to be searched as well.  Otherwise, deleted
58transactions are ignored.
60.B \-i
61Ignores case when matching against \fIsearch_regexp\fR.
63.B \fImeetings\fR
64This specifies the meetings to search; if it is left off,
65.I dsgrep
66will search all the meetings.
68A regular expression is zero or more \fIbranches\fR, separated by `|'.
69It matches anything that matches one of the branches.
71A branch is zero or more \fIpieces\fR, concatenated.
72It matches a match for the first, followed by a match for the second, etc.
74A piece is an \fIatom\fR possibly followed by `*', `+', or `?'.
75An atom followed by `*' matches a sequence of 0 or more matches of the atom.
76An atom followed by `+' matches a sequence of 1 or more matches of the atom.
77An atom followed by `?' matches a match of the atom, or the null string.
79An atom is a regular expression in parentheses (matching a match for the
80regular expression), a \fIrange\fR (see below), `.'
81(matching any single character), `^' (matching the null string at the
82beginning of the input string), `$' (matching the null string at the
83end of the input string), a `\e' followed by a single character (matching
84that character), or a single character with no other significance
85(matching that character).
87A \fIrange\fR is a sequence of characters enclosed in `[]'.
88It normally matches any single character from the sequence.
89If the sequence begins with `^',
90it matches any single character \fInot\fR from the rest of the sequence.
91If two characters in the sequence are separated by `\-', this is shorthand
92for the full list of ASCII characters between them
93(e.g. `[0-9]' matches any decimal digit).
94To include a literal `]' in the sequence, make it the first character
95(following a possible `^').
96To include a literal `\-', make it the first or last character.
98If a regular expression could match two different parts of the input string,
99it will match the one which begins earliest.
100If both begin in the same place but match different lengths, or match
101the same length in different ways, life gets messier, as follows.
103In general, the possibilities in a list of branches are considered in
104left-to-right order, the possibilities for `*', `+', and `?' are
105considered longest-first, nested constructs are considered from the
106outermost in, and concatenated constructs are considered leftmost-first.
107The match that will be chosen is the one that uses the earliest
108possibility in the first choice that has to be made.
109If there is more than one choice, the next will be made in the same manner
110(earliest possibility) subject to the decision on the first choice.
111And so forth.
113For example, `(ab|a)b*c' could match `abc' in one of two ways.
114The first choice is between `ab' and `a'; since `ab' is earlier, and does
115lead to a successful overall match, it is chosen.
116Since the `b' is already spoken for,
117the `b*' must match its last possibility\(emthe empty string\(emsince
118it must respect the earlier choice.
120In the particular case where no `|'s are present and there is only one
121`*', `+', or `?', the net effect is that the longest possible
122match will be chosen.
123So `ab*', presented with `xabbbby', will match `abbbb'.
124Note that if `ab*' is tried against `xabyabbbz', it
125will match `ab' just after `x', due to the begins-earliest rule.
126(In effect, the decision on where to start the match is the first choice
127to be made, hence subsequent choices must respect it even if this leads them
128to less-preferred alternatives.)
132egrep(1), discuss(1)
Note: See TracBrowser for help on using the repository browser.