Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: help with 'rename' function



Hello,

On Fri, Jun 12, 1998 at 04:15:57AM -0400, Timothy J Luoma wrote:
> 
> I used to have a binary that did this, but I've lost it.
> 
> What it did was simple: it changed extensions of filenames.
> 
> For example, say you have a bunch of files which ended with .THIS and you  
> wanted to change them to end with .THAT
> 
> You would do
> 
> 	rename *.THIS THIS=THAT
> 	
> and it would go on its way... or if it was just one file:
> 
> 	rename foo.THIS THIS=THAT

Apart from using mmv (I think it should be somewhere on
sunsite/mirrors), why not use this one:

for i in *.THIS ; do mv $i `basename $i .THIS`.THAT ; done

CU,
Thomas

-- 
    Thomas Köhler    Email:     jean-luc@xxxxxxxxxxxxxxxxx
        <><           WWW:    http://home.pages.de/~jeanluc/
                      IRC:               jeanluc
      LCARS --- Linux for Computers on All Real Starships



Messages sorted by: Reverse Date, Date, Thread, Author