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

Revision 12350, 5.4 KB checked in by ghudson, 26 years ago (diff)
Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.
Line 
1...
2... $Id: dsgrep.1,v 1.4 1999-01-22 23:09:38 ghudson Exp $
3...
4.TH DSGREP 1 "18 Jun 1990"
5.ds ]W MIT Project Athena
6.SH NAME
7dsgrep \- Search discuss meetings with regular expressions
8.SH SYNOPSIS
9dsgrep [-n n_trans] [-e search_regexp] [-f meetings_file]
10[-t trans_num] [-a] [-p] [-v] [-i] [meetingname1 meetingname2 ...]
11.SH DESCRIPTION
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.
17
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.
25.TP
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
31transactions.
32.TP
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.,
36.TP
37.B \-t \fItrans_num\fR
38Print out a specific transaction, by number.  When this option is used, the
39-n option is ignored.
40.TP
41.B \-a
42Causes
43.I dsgrep
44to search the text of the transactions for the regular expressions as well
45as their titles.
46.TP
47.B \-p
48Causes the text of the text of the matching transactions to be printed
49instead of just the title.
50.TP
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
54seeing.
55.TP
56.B \-d
57Causes deleted transactions to be searched as well.  Otherwise, deleted
58transactions are ignored.
59.TP
60.B \-i
61Converts the text of the titles/transactions to be converted to lower case
62before it is searched.  This allows for case-insensitive searching.
63.TP
64.B \fImeetings\fR
65This specifies the meetings to search; if it is left off,
66.I dsgrep
67will search all the meetings.
68.SH "REGULAR EXPRESSION SYNTAX"
69A regular expression is zero or more \fIbranches\fR, separated by `|'.
70It matches anything that matches one of the branches.
71.PP
72A branch is zero or more \fIpieces\fR, concatenated.
73It matches a match for the first, followed by a match for the second, etc.
74.PP
75A piece is an \fIatom\fR possibly followed by `*', `+', or `?'.
76An atom followed by `*' matches a sequence of 0 or more matches of the atom.
77An atom followed by `+' matches a sequence of 1 or more matches of the atom.
78An atom followed by `?' matches a match of the atom, or the null string.
79.PP
80An atom is a regular expression in parentheses (matching a match for the
81regular expression), a \fIrange\fR (see below), `.'
82(matching any single character), `^' (matching the null string at the
83beginning of the input string), `$' (matching the null string at the
84end of the input string), a `\e' followed by a single character (matching
85that character), or a single character with no other significance
86(matching that character).
87.PP
88A \fIrange\fR is a sequence of characters enclosed in `[]'.
89It normally matches any single character from the sequence.
90If the sequence begins with `^',
91it matches any single character \fInot\fR from the rest of the sequence.
92If two characters in the sequence are separated by `\-', this is shorthand
93for the full list of ASCII characters between them
94(e.g. `[0-9]' matches any decimal digit).
95To include a literal `]' in the sequence, make it the first character
96(following a possible `^').
97To include a literal `\-', make it the first or last character.
98.SH AMBIGUITY
99If a regular expression could match two different parts of the input string,
100it will match the one which begins earliest.
101If both begin in the same place but match different lengths, or match
102the same length in different ways, life gets messier, as follows.
103.PP
104In general, the possibilities in a list of branches are considered in
105left-to-right order, the possibilities for `*', `+', and `?' are
106considered longest-first, nested constructs are considered from the
107outermost in, and concatenated constructs are considered leftmost-first.
108The match that will be chosen is the one that uses the earliest
109possibility in the first choice that has to be made.
110If there is more than one choice, the next will be made in the same manner
111(earliest possibility) subject to the decision on the first choice.
112And so forth.
113.PP
114For example, `(ab|a)b*c' could match `abc' in one of two ways.
115The first choice is between `ab' and `a'; since `ab' is earlier, and does
116lead to a successful overall match, it is chosen.
117Since the `b' is already spoken for,
118the `b*' must match its last possibility\(emthe empty string\(emsince
119it must respect the earlier choice.
120.PP
121In the particular case where no `|'s are present and there is only one
122`*', `+', or `?', the net effect is that the longest possible
123match will be chosen.
124So `ab*', presented with `xabbbby', will match `abbbb'.
125Note that if `ab*' is tried against `xabyabbbz', it
126will match `ab' just after `x', due to the begins-earliest rule.
127(In effect, the decision on where to start the match is the first choice
128to be made, hence subsequent choices must respect it even if this leads them
129to less-preferred alternatives.)
130
131.SH SEE ALSO
132.PP
133egrep(1), discuss(1)
Note: See TracBrowser for help on using the repository browser.