[ale] quick way to rename all files ?
Gary MacKay
Gary at EdisonInfo.com
Sun Aug 26 22:50:11 EDT 2001
Wow! Thanks! That worked like a charm!
- 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.
More information about the Ale
mailing list