Re: converting uppercase into lowercase



In news:45df3e0e$0$512$e4fe514c@xxxxxxxxxxxxxxxxxxxxxxxx,
Huub" <"v.niekerk at hccnet.nl <"v.niekerk at hccnet.nl"> wrote:

I've downloaded some html files (forming a manual) and for some reason
all filenames are in uppercase while the files redirect in lowercase.
Result is that I get 'no page found' for every other page. How can I
quickly convert all filenames into lowercase? There are some 120
files.

If they're all in a single directory, you can cd there and copy and paste:

for i in *[A-Z]*; do mv "$i" "`echo $i | tr [A-Z] [a-z]`"; done

but it might be prudent to create a simple script that you see beforehand
exactly makes the changes that you want. You may need to modify the "ls
*[A-Z]*" component to a construct using "find" e.g., if the files are in
subdirectories:

cd /dir/where/files/are
echo cd \"`pwd`\" > ./junk
ls *[A-Z]* | perl -ne 'chop; \
printf "mv \"$_\" \"%s\"\n", lc $_;' >> ./junk

# Examine the file ./junk and if it meets your expectations, then:

bash ./junk

and you're finished.



.



Relevant Pages

  • Re: Uppercase filenames on FAT32
    ... Davide Capodaglio wrote: ... > If I have mixed case filenames it's all ok, but all uppercase names are ... > treated as lowercase; is it possible to change this behaviour? ...
    (alt.linux)
  • Re: converting uppercase into lowercase
    ... all filenames are in uppercase while the files redirect in lowercase. ... Perl utilities. ...
    (linux.redhat)
  • Re: converting uppercase into lowercase
    ... all filenames are in uppercase while the files redirect in lowercase. ...
    (linux.redhat)
  • converting uppercase into lowercase
    ... I've downloaded some html files and for some reason all filenames are in uppercase while the files redirect in lowercase. ...
    (linux.redhat)
  • Re: Changing Uppercase filenames into Lowercase
    ... > uses the RENAME command to rename lowercase names and ... > The filename remains uppercase because DCL uppercases ... > marks around the lowercase portion. ... To get DCL to use lowercase filenames you must enter ...
    (comp.os.vms)