Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Renaming multiple files
- X-seq: zsh-users 2881
- From: Andre Pang <andrep-ml@xxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: Renaming multiple files
- Date: Sun, 16 Jan 2000 04:11:03 +1100
- In-reply-to: <20000115105248.E868@xxxxxxxx>; from andrei@xxxxxxxx on Sat, Jan 15, 2000 at 10:52:48AM -0600
- Mail-followup-to: zsh-users@xxxxxxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <20000115105248.E868@xxxxxxxx>
- Reply-to: Andre Pang <andrep@xxxxxxxxxxx>
- Sender: andrep@xxxxxxxxxxx
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 <andrep@xxxxxxxxxxx> - Purruna Pty Ltd - ph# 0411.882299 :
: #ozone - http://www.vjolnir.org/ozone/ :
Messages sorted by:
Reverse Date,
Date,
Thread,
Author