[comp.sys.mac.wanted] Looking for a grep utility for the Mac

jtn@ADS.COM (John T. Nelson) (01/23/91)

I'm looking for a free or shareware "grep" program that will search
through multiple files like grep does.  For example, you might type in
a regular expression to search for and also specify a path name in
which to search.  Sort of like Unix find and grep rolled into one.
  I've seen something on sumex but it doesn't handle multiple files
and its handling of regular expressions was fairly stupid.

If there's nothing in the PD world, are there any commercial APPS that
are inexpensive?  What's the best out there?  I seem to recall that On
Location was the title holder but it's expensive!

This is something the programmer community needs (and I don't have
time to code it up).

Thanks in advance...



--
ORGANIZATION:  Advanced Decision Systems   GEOGRAPHIC: Arlington, VA
UUCP:          kzin!speaker@mimsy.umd.edu  INTERNET:   jtn@potomac.ads.com
SPOKEN:        John T. Nelson              PHONE:      (703) 243-1611

thomas@duteca (Thomas Okken) (01/24/91)

From article <|_7^X6$@ads.com>, by jtn@ADS.COM (John T. Nelson):
> I'm looking for a free or shareware "grep" program that will search
> through multiple files like grep does.  For example, you might type in
> a regular expression to search for and also specify a path name in
> which to search.  Sort of like Unix find and grep rolled into one.
>   I've seen something on sumex but it doesn't handle multiple files
> and its handling of regular expressions was fairly stupid.

As a matter of fact, I just downloaded the sources for GNU grep 1.5,
and ported the thing to MPW. It was a very quick and easy job, and
it seems to work quite well.
You need MPW 3.0 or later to use it, of course. It works exactly like
on Unix systems, as I've had to change practically nothing. One thing
that is confusing, however, is that you use Unix-style regular expressions
to specify the search expression, while you use MPW-style regexps to
specify which files to search.
On the up side, it is very fast. It outperforms MPW Search by a factor 4,
in some - admittedly simplistic - tests I ran on a vanilla Mac II. It
could probably be speeded up even further by compiling it with 68020
code generation, or even using GCC.
If anyone is interested in this Mac port, please let me know by e-mail.
If I get many responses, I'll post it (with sources) to comp.binaries.mac,
otherwise I'll e-mail it to those who ask.

Thomas (thomas@duteca.et.tudelft.nl)