grep replacement

Patrick Powell papowell at attila.uucp
Wed May 25 23:09:18 AEST 1988


In article <7882 at alice.UUCP> andrew at alice.UUCP writes:
>
>	Al Aho and I are designing a replacement for grep, egrep and fgrep.
>The question is what flags should it support and what kind of patterns
>should it handle? (Assume the existence of flags to make it compatible
>with grep, egrep and fgrep.)
>
>please send your comments about flags or patterns to research!andrew

The one thing I miss about grep families is the ability to have
a named search pattern. For example:

DIGIT= \{[0-9]\}
ALPHA=\{[a-zA-Z]\}
\${ALPHA}\${PATTERN}

This would sort of make sense.

The other facility is to find multiple line patterns, as in:
find the pair of lines that have pattern1 in the first line
pattern2 in the second, etc.

This I have needed sooo many times;  I have ended up using AWK
and a clumsy set of searches.

For example:
\#{1 p}Pattern
\#{2}Pattern
This could print out lines that match,  or only the first line
(1p->print this one only).

Patrick Powell
Prof. Patrick Powell, Dept. Computer Science, 136 Lind Hall, 207 Church St. SE,
University of Minnesota,  Minneapolis, MN 55455 (612)625-3543/625-4002



More information about the Comp.unix.wizards mailing list