Replacing GNU grep revisited

Dag-ErlingSmørgrav des at des.no
Sun Jun 22 12:35:29 PDT 2003


Sean Farley <sean-freebsd at farley.org> writes:
> Reasons to consider for switching:
> 1. GNU's grep -r option "is broken" according to the following post.

That reason alone is enough for me, as I regularly run into this
problem when grepping the kernel tree ("recursive directory loop" due
to back-pointing symlinks in the compile directories).  That GNU grep
has no proper control of how it treats symlinks is beyond my
understanding.  FreeGrep gets it "for free" because it uses libfts,
just like everything else in FreeBSD that needs to traverse directory
structures.  This is another argument in FreeGrep's favor: it's more
conistent with other FreeBSD utilities.

Unfortunately, FreeGrep has annoying bugs as well.  For instance, it
tries to grep the directories themselves (rather than just their
contents) when recursing, while GNU grep only greps directories if
they are explicitly listed on the command line.  Furthermore, GNU grep
will not by default show the contents of what it considers to be a
binary file (such as a directory) while FreeGrep does (causing broken
ttys and much gnashing of teeth).

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-hackers mailing list