[geeks] Re: [SunRescue] filenames..
Wolfgang Engelien
geeks at sunhelp.org
Thu May 24 13:21:44 CDT 2001
And off course there was an other error ...
>>Nope, that will try to change anything find finds to lowercase. Well, it
>>will if you insert a ']' character after the "[a-z". :-)
>
>Well, when I have the file testfile in TESTDIRECTORY
>./TESTDIRECTORY/testfile
>find will give out
>./TESTDIRECTORY/testfile
>and the mv command will try a
>mv ./TESTDIRECTORY/testfile ./testdirectory/testfile
>but can't since ./testdirectory in not existent.
>
>The original task was anyway to change the uppercase
>FILENAMES into lowercase filenames - the changing of
>directory names was not mentioned - is maybe not even
>desired.
>
>Based on the previous suggestions a solution would be
>to create a script UP2low which contains
>
>### UP2low - BEGIN ###
>cd $1
>for uppercase in `ls -p * .* | grep -v "/"`
>do
Replace the second loop (which was wrong) with this:
mv -i $uppercase `ls $uppercase|tr [A-Z] [a-z]` 2>/dev/null
>done
>### UP2low - END ###
>
>and call this script by
>find . -type d -exec UP2low {} \;
Maybe this finally will do it.
Wolfgang
#####
# Wolfgang Engelien
# Tel.: +1 (212) 746 3724
# Fax.: +1 (212) 746 5818
# email: wolfgang at hanazono.med.cornell.edu
#####
More information about the geeks
mailing list