Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Renaming multiple files



On Tue, Jan 18, 2000 at 04:41:10PM +0100,
Andy Spiegl <zsh.Andy@xxxxxxxxx> wrote:
> 
> > for i in *.phtml ; do mv $i ${i:r}.php ; done
> Nifty.  But do you guys know mmv?
> It's as easy as this:
>  mmv '*.phtml' '#1.php'

And, well, doesn't let zsh globbing work. Bad :-}

How do you do
for i in **/*.php(I) ; do mv $i ${i:r}.phtml ; done
with mmv?

[Of course mmv is faster as it only spawns one process instead of many]
[Let's try again with other means...
553 jean-luc@picard (ttypts/12) ~/test/zsh> zmodload files
554 jean-luc@picard (ttypts/12) ~/test/zsh> time (for i in *.php ;
do mv $i ${i:r}.phtml ; done )
( for i in *.php; do; mv $i ${i:r}.phtml; done )
0,09s user 0,61s system 94% cpu 0,739 total
We're in business again :-)]

> Bye,
>  Andy.

CU,
Thomas

-- 
 Thomas Köhler Email:   jean-luc@xxxxxxxxxxxxxxxxx   | LCARS - Linux for
     <><        WWW:  http://home.pages.de/~jeanluc/ | Computers on All
                IRC:             jeanluc             | Real Starships
   PGP public key: http://www.mayn.de/users/jean-luc/PGP-Public.asc



Messages sorted by: Reverse Date, Date, Thread, Author