[geeks] Re: [SunRescue] filenames..

Will Mc Donald geeks at sunhelp.org
Fri May 25 10:15:28 CDT 2001


Or (nicked from the UGU daily tips)...

This script can be used to 
renames all the file in 
current directory with 
UPPERCASE letters to lowercase.

I uses it because some time when
I try to upload some files from 
a Windows system to a unix based 
web server, the files somehow gets 
converted to UPPERCASES, which is 
undesirable.

###########################

for uppercase in `ls`
do
  for lowercase in `ls $uppercase|tr [A-Z] [a-z]`
  do
     mv $lowercase $uppercase 2>/dev/null
  done
done

############################


This tip generously supported by: ssdhawan at bhartitelesoft.com

----- Original Message ----- 
From: "Dan Debertin" <airboss at nodewarrior.org>
To: <rescue at sunhelp.org>
Cc: <geeks at mrbill.net>
Sent: Thursday, May 24, 2001 4:05 PM
Subject: [geeks] Re: [SunRescue] filenames..


> On Thu, 24 May 2001, Bill Bradford wrote:
> 
> > Anybody got a script/program that will traverse a directory tree and
> > change all filenames to lowercase?
> 
> for i in `find thedir/ -type f -print`; do
> mv $i `echo $i | perl -e '$thing = <STDIN>;print lc($thing);'`
> done
> 
> 
> --
> Dan Debertin





More information about the geeks mailing list