Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Renaming multiple files
- X-seq: zsh-users 2893
- From: Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: Renaming multiple files
- Date: Tue, 18 Jan 2000 20:00:11 +0000
- In-reply-to: "Thomas K hler"'s message of "Tue, 18 Jan 2000 17:41:16 +0100." <20000118174116.A3683@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
Thomas K hler wrote:
> 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 :-}
I wrote a function zmv that does; it would work like this:
zmv '(*).phtml' '$1.php'
(positional parameters match parentheses). The bad news is it only works
with the latest development version, not 3.1.6. However, I'll add it to
Functions/Misc from now on (it was posted to zsh-workers a few of months
ago), and it'll appear in future versions.
> How do you do
> for i in **/*.php(I) ; do mv $i ${i:r}.phtml ; done
> with mmv?
Actually, further bad news is that you can't do **/... with zmv yet, but
I expect that can be fixed. I'll have a look sometime.
--
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author