Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: grep question

  • Subject: Re: grep question
  • From: Tim Smith <reply_in_group@xxxxxxxxxxxxxxxx>
  • Date: Fri, 05 May 2006 00:23:32 GMT
  • Newsgroups: comp.os.linux.advocacy
  • Organization: Institute of Lawsonomy, Department of Suction and Pressure
  • References: <RaOdnXGrcoy5Q8rZnZ2dnUVZ_vidnZ2d@speakeasy.net> <618li3-e0o.ln1@sirius.tg00suus7038.net> <reply_in_group-CD361E.20043702052006@news.west.earthlink.net> <1436587.Q3l6MkZcx3@schestowitz.com>
  • User-agent: slrn/0.9.7.4 (OS/2 for ENIAC)
  • Xref: news.mcc.ac.uk comp.os.linux.advocacy:1106453
In article <1436587.Q3l6MkZcx3@xxxxxxxxxxxxxxx>, Roy Schestowitz wrote:
> __/ [ Tim Smith ] on Wednesday 03 May 2006 04:04 \__
>> One thing to keep in mind, though.  If you need to do anything that you
>> can't very quickly see how to do in grep or sed or whatever, then it
>> often will be faster to write a little Perl script, rather than dig
>> through the zillion options of grep, etc., trying to find the
>> combination that does what you want.
>  
> Au comtraire. In defence of grep, its basic use is simple enough to appeal to
> command-line newbies:
> 
> grep file 'search phrase' (or regular expression, if you must)
> 
> This is quicker to do than opening a file, opening search prompt/widget, then
> entering phrase. Also, grep is less computationally hungry.

Uhm...where did opening widgets come from?

> Then come to consider extensibility, recursion, batch mode (including
> scriptability), and multi-file operations. When someone sought the code of
> an error message in WordPress, for example, I immediately ran:
> 
> grep -r * 'error message substring'
> 
> to find the line in a file within a subdirectory.
> 
> That's not too complex, yet the level of expressiveness is high.

It's not too complex.  Unfortunately, it's also not correct, as you got the order
of arguments wrong. :-)

-- 
--Tim Smith

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index