Sunday, April 17, 2005

Search and replace certain words in file using Perl examples

perl -e "s/old_string/new_string/g;" -pi.save $(find DirectoryName -type f)

perl -e "s/<\!--#include virtual=\".\/menu.html\" -->//g;" -pi.bak $(find . -type f)

perl -e "s/shtml/php/g;" -pi.bak $(find . -type f)

No comments: