From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8940 invoked from network); 18 Jan 2000 15:40:51 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Jan 2000 15:40:51 -0000 Received: (qmail 6939 invoked by alias); 18 Jan 2000 15:40:32 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2887 Received: (qmail 6930 invoked from network); 18 Jan 2000 15:40:30 -0000 Date: Tue, 18 Jan 2000 16:40:29 +0100 From: Andy Spiegl To: zsh-users@sunsite.auc.dk Subject: Re: Renaming multiple files Message-ID: <20000118164029.A27035@br-online.de> Mail-Followup-To: zsh-users@sunsite.auc.dk References: <20000115105248.E868@ispi.net> <20000116041103.A1818@bozar.ihug.com.au> <20000116163112.A29827@picard.franken.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <20000116163112.A29827@picard.franken.de>; from jean-luc@picard.franken.de on Sun, Jan 16, 2000 at 04:31:12PM +0100 X-PGP-GPG-Keys: finger pgp.andy@spiegl.de OR mail -s "send pgp" auto@spiegl.de > 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@spiegl.de 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.