Find and Replace with sedFiled Under: PHP, Solaris
A lot of us will have to support code made by newbies or unconscientioius coders. Lately, I had to change the password of a database.
Unfortunately, this pass was hardcoded in a lot of php files.
Nothing’s perfect.
Hopefully, it’s easy to do a find and replace under Linux or Cygwin (or wathever) with sed.
$ find /your/directory/ -type f -exec sed -i 's/old_password/new_password/g' {} \;
This tips can be very usefull.
Tags: sed
- Permalien
- guroot
- 03:59 PM
- Comments(0)