in reply to
changing inside a file
find . -name "*.html" -exec perl -pi -e's/ old / new /' {} \;
;
-Waswas
Comment on
Re: changing inside a file
Download
Code
Replies are listed 'Best First'.
Re: Re: changing inside a file
by
amoura
(Initiate)
on Aug 26, 2002 at 18:21 UTC
this seems to work but I get this error
Can't do inplace edit without backup.
[download]
[reply]
[d/l]
Re: Re: Re: changing inside a file
by
waswas-fng
(Curate)
on Aug 26, 2002 at 19:53 UTC
find . -name "*.html" -exec perl -pi.bak -e's/ old / new /' {} \; ;
This will put a <filename>.bak backup file in place for every file that gets updated.. you must be using Activestate perl huh? mine allows inplace without a backup..
-Waswas
[reply]
[d/l]
In Section
Seekers of Perl Wisdom