Hi Simon,

On Wed, Jun 22, 2005 at 04:33:53PM +1000, Simon wrote:
> I have uploaded a web based  CD to our Moodle setup, but all the links
> are broken. In true sloppy MS style most of the filenames are in
> uppercase whereas the html files refer to them in lower case. The
> underlying webserver is Apache, (thought mod-speling might help from
> some reading but it is already installed). I am looking for the lazy way
> out of going through and editing all the links in the html files or
> renaming all the disc files, is there a solution? NB there are hundreds
> of files and corresponding links :-(

Since laziness is one of the cardinal virtues of the perl-hacker, try:

  perl -MFile::Find -e 'find sub { rename $_, lc $_ if -f $_ && $_ =~ 
m/\.html?$/i }, "."'

from the top of your cd directory tree. This will lowercase all file names 
ending in .htm, .html, .HTML, .HTM, etc., so be careful that's exactly 
what you want!

Cheers,
Gavin

-- 
Open Fusion P/L - Open Source Business Solutions [ Linux - Perl - Apache ]
ph:  +612 9875 5032                                    fax: +612 9875 4317
web: http://www.openfusion.com.au                      mob: +61 403 171712
- Fashion is a variable, but style is a constant - Programming Perl
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to