From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12862 invoked from network); 15 Jan 2000 17:07:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 15 Jan 2000 17:07:26 -0000 Received: (qmail 24298 invoked by alias); 15 Jan 2000 17:07:10 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2881 Received: (qmail 24291 invoked from network); 15 Jan 2000 17:07:09 -0000 Date: Sun, 16 Jan 2000 04:11:03 +1100 From: Andre Pang To: zsh-users@sunsite.auc.dk Subject: Re: Renaming multiple files Message-ID: <20000116041103.A1818@bozar.ihug.com.au> Reply-To: Andre Pang Mail-Followup-To: zsh-users@sunsite.auc.dk References: <20000115105248.E868@ispi.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20000115105248.E868@ispi.net>; from andrei@ispi.net on Sat, Jan 15, 2000 at 10:52:48AM -0600 Sender: andrep@vjolnir.org On Sat, Jan 15, 2000 at 10:52:48AM -0600, Andrei Zmievski wrote: > How can I rename all files with one extension to another? For example, > all *.phtml files to *.php. My (fairly dumb) solution: for i in *.phtml; do mv $i $(basename $i .phtml).php; done It does have the advantage of being fairly easy to remember and it'll work on any shell. (Well, if you change $(...) to `...`, anyway.) I'm sure somebody here can come up with an answer that'll win some obsfucated "How to rename all files with one extension to another" zsh content :). -- : Andre Pang - Purruna Pty Ltd - ph# 0411.882299 : : #ozone - http://www.vjolnir.org/ozone/ :