Hi Eoin! Long time no hear.
On Wed, 10 Jan 2007, Eoin Fitzpatrick wrote:
Hello all,
To preface, I needed to rename all the .php extensions in a given
content management system to .php5. I solved this problem by running
ls *php|sed 's/\(.*\)\.php/mv \1.php \1.php5/'|sh
in each directory used by the CMS. Any idea how I might have done this
recursively?
!#/bin/bash
for f in `find . -type f -name \*.php`; do mv -v $f ${f}5; done
I now have a whole bunch of references to non-existent .php files in
this system. Any way I could do a recursive find/replace in the textual
content of a given directory?
!#/bin/bash
for f in `find . -type f`; do mv -v $f $f.bak; sed 's/php/php5/g' $f.bak >
$f; done
I have no idea how well any of this will work!
Thanks, good to be back in school, and back in um-lug.
Eoin