[Techtalk] Re: real life kewl text-processing and regexps samples wanted

dominik.schramm at gmxpro.net dominik.schramm at gmxpro.net
Sat Jan 10 15:31:07 EST 2004


Ricky Buchanan <rb at tertius.net.au> writes:
> [...]
> perl -pie 's/\bgossamer\b/rb/g' *.txt
>
> will swap every instance of the word (as a word) "gossamer" to "rb" in
> *.txt in the current directory, making a backup of each file as
> originalfilename.bak (that's the -i) just in case of grevious error (and

If I read perlrun(1) correctly -i alone does not create backup files.
-i.blah does, with extension .blah added to the original file name.

> you do know how to use mmv to put the bak files back just in case,
> right?[1])

Never heard of mmv. Is that an alias?
Forget the question: just installed it. It *is* cool.

dominik

-- 
Dominik Schramm <dominik.schramm at gmxpro.net>
pgp key available via e-mail, web, and FTP from 
http://www.cam.ac.uk.pgp.net/pgpnet/wwwkeys.html



More information about the Techtalk mailing list