in reply to Re: simple command-line question
in thread simple command-line question

find . -exec perl -i -pe 's/mike/meathead/ig' \{\} \;

--
Ilya Martynov (http://martynov.org/)

Replies are listed 'Best First'.
Re: Re: Re: simple command-line question
by Sidhekin (Priest) on Mar 05, 2002 at 13:21 UTC
    find . -type f -print0 | xargs -0 perl -i -pe 's/mike/meathead/ig'

    Might save you a few or several thousands of processes, depending on the number of files found -- and might be a good habit to make -- at least on systems where it works. (GNU find might be needed.)

    For anything more complex than one-liners, you might prefer to use File::Find;

    The Sidhekin
    print "Just another Perl ${\(trickster and hacker)},"