Re: help with grep looking for cats and dogs
- From: Tony Lawrence <foo@xxxxxxxxxx>
- Date: Fri, 27 Jan 2006 14:44:09 -0500
Kevin Fleming wrote:
Thanks to everyone for their help on this. I'm stilll learning how scripts and the syntax works... Brian's suggestion: find /tmp -type f |xargs fgrep -l cat |xargs fgrep -l dog was the simplest for me to understand, even if it wasn't the most efficient. I promise to spend some time learning about shell scripts, and I appreciate the explanations with the examples.
Thanks again, Kevin
<OPINION>
grep is fine for simple use; I use it almost every day.
The minute I find myself piping to awk or building a line with more than one pipe in it, I stop myself and ask "Wouldn't this be easier with Perl?"
And of course the answer always is "yes".
I don't mean to discourage anyone from learning awk or shell scripting in general - it's good to know this stuff. But when your goal is to get something done efficiently and quickly, Perl is often a much better choice.
If you already know a bit about awk and grep, Perl is easy to learn -
you don't have to be expert to get a lot of mileage out of your knowledge. Take a peek at http://aplawrence.com/Unixart/loveperl.html for a gentle introduction.
</OPINION>
-- Tony Lawrence Unix/Linux/Mac OS X resources: http://aplawrence.com .
- Follow-Ups:
- Re: help with grep looking for cats and dogs
- From: Brian K. White
- Re: help with grep looking for cats and dogs
- References:
- help with grep looking for cats and dogs
- From: Kevin Fleming
- Re: help with grep looking for cats and dogs
- From: Brian K. White
- Re: help with grep looking for cats and dogs
- From: Bela Lubkin
- Re: help with grep looking for cats and dogs
- From: jdanskinner
- Re: help with grep looking for cats and dogs
- From: Kevin Fleming
- help with grep looking for cats and dogs
- Prev by Date: Re: help with grep looking for cats and dogs
- Next by Date: Re: Malicious Intent...technically possible?
- Previous by thread: Re: help with grep looking for cats and dogs
- Next by thread: Re: help with grep looking for cats and dogs
- Index(es):
Relevant Pages
|