Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Knob Re: Recursive Grep

by knobunc (Pilgrim)
on Jun 19, 2001 at 16:14 UTC ( #89615=note: print w/ replies, xml ) Need Help??


in reply to Recursive Grep

That works nicely. Alternately:

find . -type f | grep -v CVS | xargs egrep

If you alias that to something (e.g. superfind) you can do:

superfind -i whatever

Of course the intermediate grep can be eliminated if you don't have standard things to ignore. Also you can replace the egrep with your favorite grep-like substitute. By having the egrep bare at the end you can pass whatever flags you want to it.

The advantage of the above is that it is probably faster, and I can remember & type it quickly when moving from machine to machine. The downside is that I don't have all of Perl's regex language (but egrep usually has all I need for this), it will not work on non-Unix boxes without additional packages, and that I can't customize it more as needed to control the exact matches. However, xargs is a cool and often overlooked tool.

-ben


Comment on Knob Re: Recursive Grep
Select or Download Code
Re: Knob Re: Recursive Grep
by John M. Dlugosz (Monsignor) on Jun 19, 2001 at 19:37 UTC
    There is a grep written in Perl, tcgrep, that supports all of Perl's regex by nature.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://89615]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-09-18 16:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (118 votes), past polls