Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by knobunc (Pilgrim)
on May 14, 2001 at 18:00 UTC ( [id://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

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found