[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] quick way to rename all files ?
- Subject: [ale] quick way to rename all files ?
- From: byron at cc.gatech.edu (Byron A Jeff)
- Date: Mon, 27 Aug 2001 00:07:00 -0400 (EDT)
>
> Wow! Thanks! That worked like a charm!
Glad you liked it.
BAJ
>
> - Gary
>
>
> Byron A Jeff wrote:
> >
> > >
> > > Is there a quick way to rename all files in a directory to lower case?
> > > Same filename, just rip through and make sure they are all lowercase.
> >
> > This should work for bash:
> > ------------------------------------
> > for i in * ; do
> > lc=$(echo $i|tr [A-Z] [a-z])
> > if [ $lc != $i ] ; then
> > if [ -f "$lc" ] ; then
> > echo "$lc already exists"
> > else
> > mv $i $lc
> > fi
> > fi
> > done
> > -----------------------------------
> >
> > Just tested it. Seems to work. Hope it helps,
> >
> > BAJ
> > --
> > To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
>
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.