recursive grep

CW crwfl@yahoo.com
Thu Sep 30 23:42:00 GMT 1999


Here is a simple rgrep I use, never tried it with bash
however.

#!/bin/ksh
for FILE in `find . -name $2 -print`
do
	if [ `grep -c $1 $FILE` -ne 0 ]
	then
		echo $FILE
		grep -i -n $1 $FILE
	fi
done

Carson

--- Earnie Boyd <earnie_boyd@yahoo.com> wrote:
> --- Dan Richards <rodan@roving.com> wrote:
> > 
> > I'm a new cygwin user, so far I'm pretty happy,
> but...
> > 
> > Is there something I'm missing, or does this
> version of grep not support
> > a recursive option?  I've never used a grep that
> couldn't do this....
> 
> And I've never seen one that does.  I know there
> exists a package called rgrep
> that will do what you want but you'll have to find
> the source and build it.
> ===
> Earnie Boyd < mailto:earnie_boyd@yahoo.com >
> 
> Newbies, please visit
> < http://www.freeyellow.com/members5/gw32/index.html >
> 
> (If you respond to the list, then please don't cc
> me)
> __________________________________________________
> Do You Yahoo!?
> Bid and sell for free at http://auctions.yahoo.com
> 
> --
> Want to unsubscribe from this list?
> Send a message to
> cygwin-unsubscribe@sourceware.cygnus.com
> 
> 

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list