~ubuntu-branches/ubuntu/dapper/agrep/dapper

« back to all changes in this revision

Viewing changes to README

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2005-12-27 17:01:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051227170100-nk2hnq0bnlkbk3q3
Tags: 4.17-2
Added patch to fix FTBS on amd64 (Closes: #344909).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 1994 Sun Wu, Udi Manber, Burra Gopal.  All Rights Reserved. */
1
2
This is version 2.04 of agrep - a new tool for fast 
2
3
text searching allowing errors.
3
4
agrep is similar to egrep (or grep or fgrep), but it is much more general
15
16
The three most significant features of agrep that are not supported by
16
17
the grep family are 
17
18
1) the ability to search for approximate patterns;
18
 
    for example, "agrep -2 homogenos foo" will find homogeneous as well 
19
 
    as any other word that can be obtained from homogenos with at most 
20
 
    2 substitutions, insertions, or deletions.
21
 
    "agrep -B homogenos foo" will generate a message of the form
22
 
    best match has 2 errors, there are 5 matches, output them? (y/n)
 
19
        for example, "agrep -2 homogenos foo" will find homogeneous as well 
 
20
        as any other word that can be obtained from homogenos with at most 
 
21
        2 substitutions, insertions, or deletions.
 
22
        "agrep -B homogenos foo" will generate a message of the form
 
23
        best match has 2 errors, there are 5 matches, output them? (y/n)
23
24
2) agrep is record oriented rather than just line oriented;  a record
24
 
    is by default a line, but it can be user defined;
25
 
    for example, "agrep -d '^From ' 'pizza' mbox"
26
 
    outputs all mail messages that contain the keyword "pizza".
27
 
    Another example:  "agrep -d '$$' pattern foo" will output all
28
 
    paragraphs (separated by an empty line) that contain pattern.
 
25
        is by default a line, but it can be user defined;
 
26
        for example, "agrep -d '^From ' 'pizza' mbox"
 
27
        outputs all mail messages that contain the keyword "pizza".
 
28
        Another example:  "agrep -d '$$' pattern foo" will output all
 
29
        paragraphs (separated by an empty line) that contain pattern.
29
30
3) multiple patterns with AND (or OR) logic queries.   
30
 
    For example, "agrep -d '^From ' 'burger,pizza' mbox" 
31
 
    outputs all mail messages containing at least one of the 
32
 
    two keywords (, stands for OR).
33
 
    "agrep -d '^From ' 'good;pizza' mbox" outputs all mail messages
34
 
    containing both keywords.
 
31
        For example, "agrep -d '^From ' 'burger,pizza' mbox" 
 
32
        outputs all mail messages containing at least one of the 
 
33
        two keywords (, stands for OR).
 
34
        "agrep -d '^From ' 'good;pizza' mbox" outputs all mail messages
 
35
        containing both keywords.
35
36
 
36
37
Putting these options together one can ask queries like
37
38
 
86
87
 
87
88
7. fix a bug regarding exit status.
88
89
April 15, 1992
 
90
 
 
91
-------------------------------------------------------------------------------
 
92
REVISIONS TO AGREP, FALL '93
 
93
 
 
94
8. Options can now be specified in a single group of characters after one '-'.
 
95
   - Sept 3rd 1993
 
96
 
 
97
9. Made agrep callable as a library routine from a separate function. The
 
98
   interface is: memagrep(argc, argv, searchbufferlen, searchbuffer),
 
99
   the pattern to be searched for and the options being specified EXACTLY as
 
100
   if they are being specified on the command line. The only difference is
 
101
   that instead of the file-names to look at, the user should specify a buffer
 
102
   and its length. Sample user programs are in ../user directory.
 
103
   
 
104
   In memagrep(), there are TWO peculiarities:
 
105
   1. Peculiarity #1 -- at the end of the buffer, the user must have N bytes
 
106
      of valid virtual memory, where N is the length of the pattern to be
 
107
      searched. This space is used by agrep to speed up the checking of the
 
108
      termination condition. Its contents are restored before memagrep()
 
109
      returns -- however, some space must be there... else you'll get SIGSEGV.
 
110
      I might trap segv and do a longjmp, but that'll be in a new version!
 
111
   2. The search buffer must begin with a newline so that it is easy for
 
112
      agrep to output matched lines. This also avoids some copying.
 
113
   Ofcourse, if we copied the user's search buffer into another buffer which
 
114
   meets both the above conditions, memagrep() will no longer be fast -- and
 
115
   speed is the primary goal.
 
116
 
 
117
   - Sept 27th 1993
 
118
 
 
119
10. Added some filter-programs to make agrep search thru compressed files.
 
120
   Also added some features in the Makefile which allows the user to build
 
121
   an agrep with a dummyfilter so that agrep remains independent of tcompress.
 
122
   The definitions needed in agrep to interface with tcompress are in defs.h
 
123
 
 
124
   - Nov 10th 1993
 
125
 
 
126
11. Added a library interface for searching thru a specified set of files,
 
127
    fileagrep(), which is similar to memagrep(). This is used by glimpse.
 
128
    Had to modify some other things and fix some bugs (see CHANGES).
 
129
 
 
130
   - Dec 1993 (coding), Jan 1993 (debugging).
 
131
-------------------------------------------------------------------------------
 
132
 
 
133
CODING NOTE: sgrep.c and newmgrep.c use a similar while(fill_buf) loop
 
134
with start and end, while others use loops with an internal variable i.