Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Case Sensitivity in Linux Server

Reply
Thread Tools

Case Sensitivity in Linux Server

 
 
Roy Schestowitz
Guest
Posts: n/a
 
      03-23-2005
A relative of mine compiled an extensive (~3,000 files) network of
genealogical Web pages. The problem is: he built all of this on a Windows
machine and made /many/ uppercase-lowercase inconsistencies. Due to the
large bulk of files, changing this by hand would be very impractical.

Is there a way I could graft the files onto a Linux server and get them to
work properly? Are there special settings/options for the server (maybe
..htaccess)? Are there tools that scan the files and convert them in some
way (also within) to make them all lower- or upper-case?

I would greatly appreciate your help on this.

Roy
 
Reply With Quote
 
 
 
 
Toby Inkster
Guest
Posts: n/a
 
      03-23-2005
Roy Schestowitz wrote:

> Is there a way I could graft the files onto a Linux server and get them
> to work properly?


Assuming an Apache server, try mod_speling (sic).

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
 
 
 
Roy Schestowitz
Guest
Posts: n/a
 
      03-23-2005
Toby Inkster wrote:

> Roy Schestowitz wrote:
>
>> Is there a way I could graft the files onto a Linux server and get them
>> to work properly?

>
> Assuming an Apache server, try mod_speling (sic).


As I am not the sysadmin of that Web server, I don't know if this can
provide a solution. I looked up your good suggestion and found that the
CheckSpelling directive needs to be changed -- something which I cannot do
myself. Perhaps I am missing something...

Is there a script that renames all directories and files to pure lowercase
and then changes all links in the files appropriately?

Roy

--
Roy Schestowitz
http://schestowitz.com
 
Reply With Quote
 
Mitja
Guest
Posts: n/a
 
      03-23-2005
On Wed, 23 Mar 2005 15:50:36 +0000, Roy Schestowitz
<> wrote:

> Toby Inkster wrote:
>> Roy Schestowitz wrote:
>> Assuming an Apache server, try mod_speling (sic).

> CheckSpelling directive needs to be changed -- something which I cannot
> do myself. Perhaps I am missing something...

nope, that's ok. Toby assumed you had sufficient privileges to do it.

> Is there a script that renames all directories and files to pure
> lowercase and then changes all links in the files appropriately?


That's pretty basic so I doubt there's a script for it. To rename the
files to lowercase (in bash):
for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
[:upper:] [:lower:]`; done

I sort the files in reverse order before processing here so ./Foo/Bar gets
renamed before the folder Foo becomes foo and ./Foo/Bar starts pointing
nowhere.

To do the magic inside the files:
perl -p -i -e 's/(href=".*?")/\L$1/' `find -name '*.html'`

Disclaimer: tested VERY briefly, but should work.
Feel free to ask if you need any modifications/explanations.

Mitja
 
Reply With Quote
 
JDS
Guest
Posts: n/a
 
      03-23-2005
On Wed, 23 Mar 2005 18:13:56 +0100, Mitja wrote:

> Disclaimer: tested VERY briefly, but should work.


Meaning: MAKE A BACKUP OF EVERYTHING BEFORE YOU RUN THE SCRIPT. Allrighty...

--
JDS | lid
| http://www.newtnotes.com
DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      03-23-2005
Mitja wrote:
> Roy Schestowitz <> wrote:
>
>> Is there a script that renames all directories and files to pure
>> lowercase and then changes all links in the files appropriately?

>
> That's pretty basic so I doubt there's a script for it. To rename the
> files to lowercase (in bash):
> for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
> [:upper:] [:lower:]`; done


But that doesn't update the links. For that you'll probably want to do a
bit of Perl regexp stuff.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      03-23-2005
Roy Schestowitz wrote:

> As I am not the sysadmin of that Web server,


So give the sysadmin some beer and get him to do it for you. This *always*
works.

> I don't know if this can provide a solution. I looked up your good
> suggestion and found that the CheckSpelling directive needs to be
> changed -- something which I cannot do myself.


Not even in an .htaccess file?

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      03-23-2005
Toby Inkster wrote:
> Mitja wrote:
>
>>Roy Schestowitz <> wrote:
>>
>>>Is there a script that renames all directories and files to pure
>>>lowercase and then changes all links in the files appropriately?

>>
>>That's pretty basic so I doubt there's a script for it. To rename the
>>files to lowercase (in bash):
>>for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
>>[:upper:] [:lower:]`; done

>
> But that doesn't update the links. For that you'll probably want to do a
> bit of Perl regexp stuff.


Are you sure you read Mitja's whole post?

> To do the magic inside the files:
> perl -p -i -e 's/(href=".*?")/\L$1/' `find -name '*.html'`


 
Reply With Quote
 
Toby Inkster
Guest
Posts: n/a
 
      03-23-2005
Leif K-Brooks wrote:

> Are you sure you read Mitja's w


Whole posts are so old fashioned.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact

 
Reply With Quote
 
Roy Schestowitz
Guest
Posts: n/a
 
      03-24-2005
Mitja wrote:

> On Wed, 23 Mar 2005 15:50:36 +0000, Roy Schestowitz
> <> wrote:
>
>> Toby Inkster wrote:
>>> Roy Schestowitz wrote:
>>> Assuming an Apache server, try mod_speling (sic).

>> CheckSpelling directive needs to be changed -- something which I cannot
>> do myself. Perhaps I am missing something...

> nope, that's ok. Toby assumed you had sufficient privileges to do it.
>
>> Is there a script that renames all directories and files to pure
>> lowercase and then changes all links in the files appropriately?

>
> That's pretty basic so I doubt there's a script for it. To rename the
> files to lowercase (in bash):
> for $fn in `find -name '*.html' | sort -r`; do mv $fn `echo $fn | tr
> [:upper:] [:lower:]`; done
>
> I sort the files in reverse order before processing here so ./Foo/Bar gets
> renamed before the folder Foo becomes foo and ./Foo/Bar starts pointing
> nowhere.
>
> To do the magic inside the files:
> perl -p -i -e 's/(href=".*?")/\L$1/' `find -name '*.html'`
>
> Disclaimer: tested VERY briefly, but should work.
> Feel free to ask if you need any modifications/explanations.
>
> Mitja


I found some other solution in the mean time. It is very similar and I am
writing about it at the moment:

http://www.schestowitz.com/Software/Lowercase/

Roy
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Eclipse Search and Replace with Emacs like Case Sensitivity eschreiber@gmail.com Java 0 01-25-2005 04:42 PM
question on URL case sensitivity Kev HTML 15 01-03-2005 05:36 AM
Case Sensitivity of Component Names Not Consistent? Harry Whitehouse ASP .Net 0 09-15-2004 01:08 AM
case sensitivity for Thunderbird message filter Maleki Firefox 1 08-26-2004 06:26 AM
Thunderbird Message Filter Case Sensitivity Maleki Firefox 0 08-16-2004 02:48 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57