Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Renaming multiple files
- X-seq: zsh-users 2887
- From: Andy Spiegl <zsh.Andy@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: Renaming multiple files
- Date: Tue, 18 Jan 2000 16:40:29 +0100
- In-reply-to: <20000116163112.A29827@xxxxxxxxxxxxxxxxx>; from jean-luc@xxxxxxxxxxxxxxxxx on Sun, Jan 16, 2000 at 04:31:12PM +0100
- Mail-followup-to: zsh-users@xxxxxxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <20000115105248.E868@xxxxxxxx> <20000116041103.A1818@xxxxxxxxxxxxxxxxx> <20000116163112.A29827@xxxxxxxxxxxxxxxxx>
> 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