>>>>> "Arun" == Arun Sharma <[EMAIL PROTECTED]> writes:

    Arun> On Wed, Feb 02, 2000 at 06:31:21PM +0530, Syed Khader Vali
    Arun> wrote:
    >> Do not fear as rgrep is near !! Use it dude ;-) And as for my
    >> grep it is like this ;-)
    >> 
    >> sidgeek@DemiUrge:~$ grep --version grep (GNU grep) 2.4
    Arun> Don't let your UNIX be corrupted by such unholy ideas :) Do
    Arun> as Raj suggested:
    Arun> find . -name '*.pattern' | xargs grep word
    Arun> Keep grep simple - not every command needs to know how to do
    Arun> pattern matching and file tree walking :)

And while I am not worried whether I am right or wrong !!
I would like to explain one two things about why using
using 
find . -type -name "someghhing.ext" -exec grep serching {} \;
is not suggested where as what 
arun suggested find . -name '*.pattern' | xargs grep word
is right !!

-- start explanation ;-) ----------------

The use of the -exec flag causes a lot of overhead that can be eliminated with the 
command xargs.
xargs is a command that is used to build  and  execute  command lines from standard 
input.
The one which Arun suggested is faster and more efficient (?) because only one copy of 
grep will be
spawned rather than one copy of grep for every file that matches

-- end explanation ;-) --------------------------

HTH
Regards
        Khader

-- 
------------------------------------------------ @}-----------------
Syed Khader Vali (Siddiq)                          [EMAIL PROTECTED]
pub  1024D/3C6A199D 
sub  2048g/E3A76B00
Key fingerprint = 7F85 2C03 CA1F 5ABD F099  E8D3 392A 9A11 3C6A 199D
Debian 2.2.4 (potato)                       http://www.sidcarter.com

--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.

Reply via email to