Re: [SLUG] Utility challenge

From: Ed Centanni (ecentan1@tampabay.rr.com)
Date: Fri Jul 06 2001 - 07:42:58 EDT


Silly me.. I knew about basename but I forgot that basename accepted
suffix arguments.

Thanks all who replied.
Ed

Brian Coyle wrote:
>
> Ed Centanni wrote:
> >
> > What's the best way -- either by command line or a shell script -- to
> > change a group of files names. EX. change all the files with a
> > specific extension to another name: *.jpeg to *.JPG
> >
> > mv just doesn't seem to cut it.
> > Ed.
>
> How 'bout:
>
> $ for f in *.jpeg ; do mv $f $(basename $f jpeg)JPG ; done
>
> note there is NO DOT in the mv/basename component since basename
> strips the suffix, but not the dot...
>
> HTH!
>
> --
> Redundancy? You can say that again!



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:38:36 EDT