http://www.perlmonks.org?node_id=80201


in reply to Re: All files in dir to Storable.pm data
in thread All files in dir to Storable.pm data

Or for people without rgrep:

find . -type f | xargs grep "whatever you want"

Which I alias (using bash) to:

alias superfind='find . -type f | xargs grep'
For that mod 1970's feel.

-ben

Replies are listed 'Best First'.
find and xargs and grep - add that /dev/null!
by merlyn (Sage) on May 14, 2001 at 18:02 UTC
    You won't get the filename prefix if xargs happens to hand grep only one item though. Always throw an extra /dev/null in there, which will be opened and bypassed, but is enough to ensure more than one filename at all times:
    find . -type f -print | xargs grep "whatever you want" /dev/null

    -- Randal L. Schwartz, Perl hacker

Re: Re: Re: All files in dir to Storable.pm data
by jepri (Parson) on May 14, 2001 at 18:16 UTC
    But to make sure you don't get screwed up by funny filenames, use:

    find . -type f -print0 | xargs -0r -iXX grep "word" XX

    I don't know how to work that into an alias though.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.