Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Easy Substitution Oneliner (See related posts)

Suppose you have a bunch of files where you need to make the same substitution. This oneliner will make the substitution and keep the old version in backups. This is particularly handy for configuration files.

   1  
   2  perl -p -i.bak -e 's:oldtext:newtext:g' *.conf


You need to create an account or log in to post comments to this site.


Click here to browse all 5502 code snippets

Related Posts