in reply to Inplace Editing

On the principle that shorter is better I do it like this:

perl -p -i -n -e 's/this/that/g' *.txt

BTW when I use -pine for the switches it doesn't work, anyone know why?

Replies are listed 'Best First'.
Re: Re: Inplace Editing
by Hofmator (Curate) on Aug 21, 2001 at 21:00 UTC

    Know your command line switches ;-) ... two things

    • -p and -n contradict each other (and actually p overrides n).
    • -pine switches on the p switch and uses backup files which append ne to the filename - so my suggestion is -pi -e.

    -- Hofmator