On Tue, 4 Sep 2001, Jason Murray wrote:
> But then, the right tools make the job easy regardless of
> platform.

For sure!  I don't bother with all that clicking ... now you [Unix folk]
don't have to either :)

#!/bin/sh
for PHP3FILE in `find . -type f -name "*.php3" -print`
do
        PHP4FILE=`echo ${PHP3FILE} | sed 's/\.php3/\.php/g'`
        sed 's/\.php3/\.php/g' ${PHP3FILE} > ${PHP4FILE}
done
#END OF SCRIPT

That recursively finds all files starting in whatever directory you like,
and creates the newly-named files with all the references corrected as
desired (with a small addition, the old files can be archived or removed).

I just had some fun with that script and a copy of an old doc root ... 17
directories, deepest directory was at 3 levels, and 216 .php3 files (from
1998 :) ... took a few seconds to make all the modifications.

        ~Chris                           /"\
                                         \ /     Pine Ribbon Campaign
Microsoft Security Specialist             X      Against Outlook
The moron in Oxymoron.                   / \     http://www.thebackrow.net



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to