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

Re: Renaming multiple files



> 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'

> Well, works with zsh - and is of course shorter, doesn't need basename
> etc... :-)
dito. :-)

> jean-luc@picard (ttypts/5) ~/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 )
>  3,22s user 5,04s system 99% cpu 8,328 total

eule:~/tmp>time mmv '*.phtml' '#1.php'
 0,03s user 0,46s system 100% cpu 0,487 total

What is 3,22 divided by 0,03?  :-)

Bye,
 Andy.

-- 
 E-Mail: Andy@xxxxxxxxx     URL: http://andy.spiegl.de
 PGP/GPG: see headers
                                o      _     _         _
  --------- __o       __o      /\_   _ \\o  (_)\__/o  (_)
  ------- _`\<,_    _`\<,_    _>(_) (_)/<_    \_| \   _|/' \/
  ------ (_)/ (_)  (_)/ (_)  (_)        (_)   (_)    (_)'  _\o_
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Harrisberger's Fourth Law of the Lab:
         Experience is directly proportional to
         the amount of equipment ruined.



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