[Novalug] how to change file names for CAPITALS to lower case
donjr
djr1952@hotpop.com
Wed Feb 14 19:48:57 EST 2007
On Wed, 2007-02-14 at 19:22 -0500, Angelo Bertolli wrote:
> Nino Pereira wrote:
> > This topic was discussed once before, but I forgot
> > the conclusion. Can anyone remind me of the answer?
> >
> > I have a directory with lots of files, with file names
> > in capitals. I want to change all the file names
> > to lower case.
>
> I'll make a guess:
>
> ls | while read file
> do
> new=`echo $file | tr [:upper:] [:lower:]`
> mv -v "$file" "$new"
> done
>
What about the possible there are directories mixed in with the files?
Not sure what your version would do.
What about the case where a LOWERCASE version of the file name already
exists?
Your version would REPLACE the original LOWERCASE version with the
date from the uppercase version.
--
--
Don E. Groves, Jr.
$ /usr/games/fortune :
Q: What's a light-year?
A: One-third less calories than a regular year.
More information about the Novalug
mailing list