On Sunday 12 August 2001 06:44 am, George Petri wrote:

> Surely, grep can do something this basic, can't it
> (didn't the author of grep write c programs too:)?
> I don't like find and its complexity very much.

Recall that the tools in Unix are (or at least were at one point) designed to 
do one thing well, and do it simply. If there is a command that will return a 
list of files, there really isn't a need for that functionality to be put 
into another command that does something else. 

Unfortunately, find can be difficult to learn to use and it does have a lot 
of options. I tend to prefer something like :

# grep whatever `find . -name *.c`

By using the backquotes, that simply  substitutes the filenames that find 
returns right into the grep command line. But that can be impractical as find 
could return a great deal of filenames (thus a very long command line). But 
it's easier to type :).

It does turn out that the xargs solution is likely less stressful on the 
system. 

Grep actually can recurse - by using the -r switch on grep, it'll go through 
all files in a directory and directories within the parent directory (or 
matching filenames).

> 55 days?  That's 2 months!  My X seems to die under heavy loads
> -- under that load average of 51.29 on a single Pentium II, X didn'

yeah, but I usually don't run the load average quite that high :). I don't 
think it's necessarily a case of the X server dying, but maybe the system is 
so stressed out that it's hard for it to respond to keystrokes or anything 
else. Recently I've noted a few tiimes where this has happened to me - 
sometimes by killing the X server and getting out of KDE I can reclaim the 
system. So far, I haven't had to reboot -- not in the last two months or so 
:).

> George

-- 
------------------------------------------------------------------------
David E. Fox                              Thanks for letting me
[EMAIL PROTECTED]                            change magnetic patterns
[EMAIL PROTECTED]               on your hard disk.
-----------------------------------------------------------------------

Reply via email to