All pastes #365501 Raw Edit

Mine

public text v1 · immutable
#365501 ·published 2007-02-21 00:26 UTC
rendered paste body
#!/bin/sh
# Perform an simple update on all php-script in current directory + subdirs
# Updates from "<?" to "<?php" (without the quotes)
fileslist=`find . -iname '*.php'`

for textfile in $fileslist
do
        echo -e "\0033[0;32m * \0033[0m Updating $textfile to newer php-standards..."
        cp "${textfile}" "${textfile}.old"
        sed -e 'N;s/<?[\n]/<?php\n/g' "${textfile}.old" > "${textfile}.unique.tmp"
        sed -e 's/<? /<?php/g' "${textfile}.unique.tmp" > "${textfile}.unique.tmp1"
        sed -e 's/<?=/<?php echo/g' "${textfile}.unique.tmp" > "${textfile}"
        rm "${textfile}.unique.tmp"
        rm "${textfile}.unique.tmp1"
done

----


*  Updating ./OBA/anime to newer php-standards...
cp: cannot stat `./OBA/anime': No such file or directory
sed: can't read ./OBA/anime.old: No such file or directory
 *  Updating forening.php to newer php-standards...
cp: cannot stat `forening.php': No such file or directory
sed: can't read forening.php.old: No such file or directory