mass word find/replace

Bernard El-Hagin bernard.el-hagin at lido-tech.net
Wed Jan 7 07:29:25 PST 2004


Mark wrote:

>I am trying to find a way to replace one word in a file
>with another word, like windows wordpad find/replace.
>
>I need to change pn_ to nuke_ and have a 188000 lines to do it on. ugh


   perl -i.bak -pe 's/pn_/nuke_/g' /input/file(s)


The old file(s) will be saved with the extension .bak.


-- 
Cheers,
Bernard


More information about the freebsd-questions mailing list