RE: [PHP] Find and Replace

From: Date: Mon, 30 Jul 2001 19:34:18 +0000
Subject: RE: [PHP] Find and Replace
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60269@lists.php.net to get a copy of this message
On 30-Jul-2001 Shrout, Ryan wrote: > This isn't exactly PHP I need help with, but it relates to what I learned > about security. Up until now, I have been using *.inc extensions for my > include files. Well, I didn't realize until recently that anyone can view > these files. So, I want to rename them to *.inc.php. BUT, in almost all of > my PHP pages, there are links to : include ('mydir/myfile.inc'); > > Can someone tell me how to do a recursive find and replace to look for > /myfile.inc and replace it with myfile.inc.php? I am running Red Hat 7.1 > http://www.splitinfinity.com/tips/4.html -- or my quick & dirty: vi grep -l -r "foo" * and then cut-paste :g/foo/s//bar/g in each file Regards, -- Don Read dread@texas.net -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.

« previous php.general (#60269) next »