RE: Is echo tag reasonably portable?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Nov 2005, Jim Moseby wrote:

for file in *.php; do
cp $file $file.tmp
sed -e "s/<?$/<?php/g" $file.tmp >$file
rm $file.tmp
done

I maintain: "Better to save the grief and do it right to start with, no?"

Maybe at some point I too will be lucky enough to only work on code that I authored.

for file in *.php; do
cp $file $file.tmp
php -r 'echo preg_replace("/<\?php=\s*/i","<?php echo ",preg_replace("/<\?(?!php)/i","<?php",file_get_contents($argv[1])));' $file.tmp >$file
rm $file.tmp
done


--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux