From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12112 invoked from network); 18 Jan 2000 19:58:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Jan 2000 19:58:08 -0000 Received: (qmail 7794 invoked by alias); 18 Jan 2000 19:57:52 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2893 Received: (qmail 7787 invoked from network); 18 Jan 2000 19:57:51 -0000 To: zsh-users@sunsite.auc.dk Subject: Re: Renaming multiple files In-reply-to: "Thomas K hler"'s message of "Tue, 18 Jan 2000 17:41:16 +0100." <20000118174116.A3683@picard.franken.de> Date: Tue, 18 Jan 2000 20:00:11 +0000 From: Peter Stephenson Message-Id: Thomas K hler wrote: > On Tue, Jan 18, 2000 at 04:41:10PM +0100, > Andy Spiegl 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