Skip to Content.
Sympa Menu

baslinux - [BL] bash help; changing case of file names, hyperlinks

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: James Miller <jamtat AT mailsnare.net>
  • To: BL listserv <baslinux AT lists.ibiblio.org>
  • Subject: [BL] bash help; changing case of file names, hyperlinks
  • Date: Fri, 23 Feb 2007 13:03:21 -0600

I've run across a problem that a bash script might resolve. But my bash
skills are
rudimentary at best. I'd therefore like to ask for help with this project.
I've
downloaded a grouping of html files I want to have resident on my home
computer. The
files are linked together in series and link one to another from within each
html file
as well as from some centralized index pages. The problem is that this
grouping of
files was created by some (not too bright) M$ user who paid little or no
attention to
case sensitivity. Sometimes file names are in lower case, sometimes in upper
case
(mostly upper case). The problem, as should be clear, is that the links don't
work on
a Linux system if the case is not properly specified in the hyperlink. What I
therefore need to do is convert the relevant file names, whether under their
resident
directory, or within the html files themselves, to either upper or lower
case. It
could be alot more complex to do this if the file names varied more than they
do, but
as things stand, there are only 5 words that need their case changed.

For demonstration purposes, let's say that the relevant words are index, htm,
word1,
word2, and word3. What would be the automated way to change all instances of
index,
htm, word1, word2, and word3 to INDEX, HTM, WORD1, WORD2, and WORD3? I
suppose the
routine for doing this would be different for renaming the files than it
would be for
changing the case of hyperlinks inside an html file. Any help on this would
be much
appreciated.

Thanks,
James




Archive powered by MHonArc 2.6.24.

Top of Page