Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by knobunc (Pilgrim)
on May 14, 2001 at 18:00 UTC ( #80201=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Re: All files in dir to Storable.pm data
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://80201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2014-07-31 03:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (244 votes), past polls