I’m a big fan of the “replace” utility included in the mysql client package. With this utility you can search/replace a string of text across multiple files like this:
1 |
replace 'from-string' 'to-string' -- start-folder/*.pl |
Quick and easy!
But on occasion I’m on a system that doesn’t have the mysql client package so here’s a similar function using find and sed:
1 |
find start-folder/ -name '*.pl' -exec sed -iorig 's/from-string/to-string/' {} \; |