As I recently moved to Ubuntu 8.04 (plus CompizFusion + AWN which is rocking my world), I am now back to the good old days where bash was there to save my life. So basically I needed to SVN rename (also known as move) all my thtml views to ctp, recursively. Since this is a short tip, I’ll get down to the details. Just cd to your /views path in CakePHP, and issue:
for file in `find . -name "*.thtml"` ; do svn mv $file `echo $file | sed s/\.thtml/\.ctp/` ; done
After that you can safely commit. Enjoy!
Related posts:






Dieter_be [Visitor] wrote:
Be careful. You should put double quotes (“”) around your $file (“$file”) to protect from special characters – such as spaces – in your filenames.
Link
mariano.iglesias [Member] wrote:
@Dieter_be: good thinking, though I doubt you could get away with a CakePHP view with a space on it
Link
Mario César [Visitor] wrote:
Thanks ! thank you very much !
Link
squawk [Visitor] wrote:
You can also use the -exec flag in find:
find . -name “*.thtml” -exec svn mv {} `echo {} | sed s/\.ctp/\.thtml/` \;
Link
dr. Hannibal Lecter [Visitor] wrote:
Man, sometimes I’d just like to kick some bottoms when I see the poor “command line interface” Windoze has.
So many great things on Unix/Linux…
Link