Walt Mankowski on 2 Dec 2003 16:34:02 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] search and replace multiple files?


On Tue, Dec 02, 2003 at 04:16:31PM -0500, gabriel rosenkoetter wrote:
> On Tue, Dec 02, 2003 at 01:09:27PM -0800, John Fiore wrote:
> >       perl -pie 's/foo/bar/' file1
> > 
> > I get the error:
> >      Can't open perl script "s/foo/bar/": No such file
> > or directory
> 
> Try perl -pi -e 's/foo/bar/' <files>
> 
> Parsing of -e as part of a block of switches appears to be broken,
> at least with my copy of 5.6.1.

Actually the problem is that the -i switch is grabbing the e to be the
extension to rename its backup files.

Oh well, guess that just proves the importance of testing one-liners
before sending them out to the list.  Sorry about that. :(

Walt

Attachment: pgpAL5GUxne5D.pgp
Description: PGP signature