[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Renaming multiple extensions-file on unix..



On Tue, May 27, 2003 at 09:28:03AM +0200, Emil Pedersen wrote:
> "Miranda, Joel Louie M" wrote:
> > I have this html pages and I just want to rename them all into *.php
> > Anyone have any ideas? Doing this in just one command? Or Just a script?
> 
> Hi,
> 
> you could install "mmv" (multiple mv) which is close to perfect for
> these things.
>   One other way would be to run something like:
> 
> 	for f in *html; do mv $f ${f//.html/.php}; done
> 
> which should work if there's not to many files.  Note that I think it
> requires bash though.

It does. "${f%.html}.php" doesn't.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: