In a message dated: Mon, 29 Jan 2001 19:24:52 EST
Kurth Bemis said:
>thanks to Microsoft and their wisdom i now have ~200 files that used to be
>all lowercase...now their all caps. their web sites so now everything is
>broken. does anyone know or a util or a script that will let me make all
>the filenames lowercase?
I haven't read Ben's response yet, so I don't know if your question has been
answered, but in the name of TMTOWTDI, I offer this as a potential solution:
for i in `find ./ -type f`
do
DIR=`dirname $i`
FILE=`basename $i`
NEW=`echo $FILE | tr [:upper:] [:lower:]`
cp $DIR/$FILE $DIR/$NEW
done
You can replace the 'cp' with 'mv' if you're really confidant :)
All this does for those who can't read shell code is:
- runs the find command in the current directory looking for "regular"
files (i.e. not directories)
- Saves the directory name of the file in DIR
- Saves the file name in FILE
- echos the file name in FILE and pipes it through the 'tr' command
which translates all uppercase to lowercase and saves the result
in NEW
- copies the old filename containing uppercase to the same name
only all lowercase
This may or may not do what you need, but it does do exactly what I just
described. You could also probably solve this with 1-2 lines of perlcode
as well :) (Anyone up for that?)
HTH,
--
Seeya,
Paul
----
It may look like I'm just sitting here doing nothing,
but I'm really actively waiting for all my problems to go away.
If you're not having fun, you're not doing it right!
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************