new grep

guy at gorodish.UUCP guy at gorodish.UUCP
Fri Jul 1 17:05:12 AEST 1988


> Of course it didn't work right until you fixed the bug...

To what bug are you referring?  I just built the standard "grep" and "egrep"
from the standard S5R2 source, and at least "grep -i aarhus /usr/dict/words"
worked.  There was a bug in "fgrep", fixed in the "V7 addendum tape" version
(and thus in the 4BSD version) but not in the S5 version, but I don't think it
had anything to do with case-mapping (if somebody has the original bug fix that
I posted, could they mail it to me - I no longer remember what the bug was, and
may need to know what it was).

There may have been performance problems, but at least they worked....

> By the way, this is another case where separate tools might be better.

> There are languages (and character sets) for which "case" is not a
> relevant concept.

So don't use "-i" with files containing text in those languages.

> And even the fast case mapping code from 4BSD (which again Guy put into the
> SVR2 version and I picked it up for ours, but don't know about AT&T's
> current version) still adds some degree of overhead that is wasteful in the
> usual case.

Wasteful, maybe, but noticeable?  "grep" and "egrep" lower-casify the pattern
argument, but that's cheap.  "grep" tests the "-i" flag once per line, and
"egrep" (done right) tests it only when building the FSM, not when reading the
file.  "fgrep" tests it more often, so that's the only case where I see any
value to worrying about overhead in the usual case.  I infer from your
reference to the "fast case mapping code from 4BSD", which appeared in "fgrep",
that you may be referring to "fgrep"; the S5R3 version has a different form of
fast case mapping.



More information about the Comp.unix.wizards mailing list