[svlug] Caps on my Cisco Networking CD
Seth David Schoen
schoen at uclink4.berkeley.edu
Fri Nov 6 15:57:02 PST 1998
Scott writes:
> Hello. I am taking this Cisco Networking class at school and I have a
> cd w/ all the lessons. We use netscape to view these. The only problem
> is that when we made the cd we made it in windows95 and i guess it made
> all of the filenames capitals. Now whenever i click on the a link it
> wont find it because the directory and the file names are all caps
> instead of lower case. There are like thousands of files on this cd.
> Literally i mean more than 5,000 files on this cd. Lots of images and
> movies and html pages. There is no way that I am going to be able to
> change this all to lowercase. I know that there are some smart fellows
> out there that are just wizzes at perl or c. If any of you could write
> me a short little app that would change these filenames to lowercase
> that would be just swell if it isnt too much to ask. If there is a
> program already out there that does that and you know the name of it
> please tell me that would be just great. Thanks for your time.
There are lot of options for writing scripts to do this, but an appropriate
place to start looking for solutions is in the origin of the problem: how
the filesystem is mounted. Take a look at the man page for mount(8).
You'll see that you can
mount -t iso9660 -o check=relaxed /dev/cdrom /mnt/cdrom
Look around further in mount(8) and you'll see other information relevant
to how filesystems are interpreted upon being mounted.
Here's your script, incidentally: run these two "find" commands.
PREFIX=/cool-place
find /source -type d -exec withlcase $PREFIX/'{}' mkdir -p \;
find /source -type f -exec withlcase $PREFIX/'{}' cp '{}' \;
The "withlcase" script is:
#!/bin/sh
# withlcase: execute $2, ... with lowercase($1) as argument
FILE=`echo "$1" | tr [A-Z] [a-z]`
shift
$* $FILE
This does work (in my little test), but should be unnecessary. You get a
/cool-place/source tree containing the original /source, but with lower-case
filenames. (There are some problems, like if two file have the same name,
or if there were symlinks in the original, but for your situation, this
should also work.)
--
Seth David Schoen L&S '01 (undeclared) / schoen at uclink4.berkeley.edu
He said, "This is what the king who will reign over you will do." And they
said, "Nay, but we will have a king over us, that we also may be like all the
nations." (1 Sam 8) http://ishmael.geecs.org/~sigma/ http://www.loyalty.org/
--
echo "unsubscribe svlug" | mail majordomo at svlug.org
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ to unsubscribe
More information about the svlug
mailing list