help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: searching elisp on debian/ubuntu


From: Bob Proulx
Subject: Re: searching elisp on debian/ubuntu
Date: Fri, 25 Oct 2013 09:55:54 -0600
User-agent: Mutt/1.5.21 (2010-09-15)

Rustom Mody wrote:
> ... nuisance ...
> find /usr/share/emacs/23.4/lisp *.gz|xargs zgrep <something>
> because zgrep unlike grep has no recursive flag

I am compelled to disagree.  If we were sitting around a pub this
would be a good philosophical discussion!  In the meantime we will
just have to do it virtually on email. :-)

Sure 'grep' added a --recursive option.  But it added a huge amount of
code for it too.  And immediately people started filing bugs saying
they wanted it to do something different on different types of files.
They wanted to ignore special files like character devices.  Or they
didn't.  They wanted it to skip over pipes instead of blocking reading
them waiting for input.  And then another said they were using that
feature and wanted it to read pipes.  And of course people asked to
skip some file name patterns.  And then others wanted to include some.
Should it follow symbolic links or not?  Pretty soon all of 'find'
must be recreated using a different syntax.  And after having learned
how to work grep's implementation of recursive behavior it might not
work for other utilities that might implement it differently.

Using 'find' is superior.  Once you learn the syntax of find you can
apply it to any of the utilities.  The 'find' command is a general
purpose command that works not just in one program like grep but in
all of the other programs and utilities on the system!

So I think that your lament about zgrep lacking --recursive and
needing to use find is not about a lack in zgrep but rather about a
lack of vision in grep and the good design of Unix and find that find
was already there to do the job.  Find was there for zgrep even though
zgrep had not been written when find was written.

It isn't a nuisance.  It is a joy of good design! :-)

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]