On Wed, Jan 10, 2007 at 12:48:14PM -0500, 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?
find . -name \*.php |sed 's/\(.*\)\.php/mv \1.php \1.php5/'|sh
> 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?
This might work:
find . -name \*.html | xargs perl -ane '@files=grep /\S+.php/, @F; foreach
$file (@files){ print unless(-f $file)}'
- Rob
.