man tre-agrep (Commandes) - print lines approximately matching a pattern

NAME

tre-agrep - print lines approximately matching a pattern

SYNOPSIS

tre-agrep [OPTION]... PATTERN [FILE]...

DESCRIPTION

Searches for approximate matches of PATTERN in each FILE or standard input. Example: `tre-agrep -2 optimize foo.txt' outputs all lines in file `foo.txt' that match "optimize" within two errors. E.g. lines which contain "optimise", "optmise", and "opitmize" all match.

Regexp selection and interpretation:

-e, --regexp=PATTERN
use PATTERN as a regular expression
-i, --ignore-case
ignore case distinctions
-w, --word-regexp
force PATTERN to match only whole words

Approximate matching settings:

-D, --delete-cost=NUM
set cost of missing characters
-I, --insert-cost=NUM
set cost of extra characters -S, --substitute-cost=NUM set cost of wrong characters
-E, --max-errors=NUM
select records that have at most NUM errors
-#
select records that have at most # errors (# is a digit between 0 and 9)

Miscellaneous:

-d, --delimiter=PATTERN
set the record delimiter regular expression
-v, --invert-match
select non-matching records
-V, --version
print version information and exit
-y
does nothing (for compatibility with the non-free agrep program)
--help
display this help and exit

Output control:

-B, --best-match
only output records with least errors
-c, --count
only print a count of matching records per FILE
-h, --no-filename
suppress the prefixing filename on output
-H, --with-filename
print the filename for each match
-l, --files-with-matches
only print FILE names containing matches
-n, --record-number
print record number with output
-s, --show-cost
print match cost with output

With no FILE, or when FILE is -, reads standard input. If less than two FILEs are given, -h is assumed. Exit status is 0 if a match is found, 1 for no match, and 2 if there were errors. If -E or -# is not specified, only exact matches are selected.

PATTERN is a POSIX extended regular expression (ERE) with the TRE extensions. See tre(7) for a complete description.

REPORTING BUGS

Report bugs to Ville Laurikari <vl@iki.fi>.

COPYRIGHT

Copyright © 2002-2004 Ville Laurikari.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.