Solved

Problem in shifting site from windows to linux

Posted on 2002-07-26
21
186 Views
Last Modified: 2010-04-09
we shifted some site from windows based web  server to linux but found that there are some issues due to Linux being case sensitive. Some images/files name are in lower case, some are in mixed and some are in Upper case, but while calling those images/files, name are not given in proper case and which results in not showing those images/files which browsing. Is there any tool which can change all the files name in A HREF""  tag?? Please help its urgent

Thanks
0
Comment
Question by:india_bb
  • 7
  • 5
  • 3
  • +4
21 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 7181842
perl -ne 'm:(.*\s+HREF=["]?)([^">]*)(["]?>.*):&&do{print $1,lc($2),$3,"\n";next;};print;' file

# to be improved in many ways ..
0
 
LVL 47

Expert Comment

by:dbrunton
ID: 7181909
Or you could use sed.  sed is a stream editor used on text files and it also has the ability to search out strings of text and find and replace text.

sed can be downloaded freely from the InterNet.  

WARNING.  You should get the 32 bit version of sed especially if your files are large.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7182175
files are already on linux, you do not need to think about "32 bit". erl is part of almost all linuxs (as well as sed).
sed might do it also, but it is more complicated in this case, 'cause there are so much variants of HREFs. For most variants you need a separate s command, unfortunatelly.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7182179
oops, forgot to say that sed alone can not do it, you need at least one pipe to tr also. Then trouble starts ...
0
 
LVL 18

Expert Comment

by:bruno
ID: 7182241
why not just rename all the files lowercase, then use a program that will make all your code lowercase as well?
0
 
LVL 2

Expert Comment

by:garfld
ID: 7182379
"Is there any tool which can change all the files name in A HREF""  tag??"

Homesite is a great text editor that I use for all my webdesign. You can convert the case of all the tags in one document, all to lower case (or all to upper if you wanted). Take a look at it.

Betsy
0
 
LVL 18

Expert Comment

by:bruno
ID: 7182386
Betsy,

if you'll note my suggestion one above yours, I left that with Homesite in mind, as that's also what I use, and was thinking of the built in HTML Tidy support...

I suppose Tidy could be used on it's own as well...
http://www.w3.org/People/Raggett/tidy/


BRUNO
0
 
LVL 2

Expert Comment

by:garfld
ID: 7182409
sorry, not trying to stop on toes, didn't see any specific program mentioned.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7182487
oh no, not at all, we are just thinking alike here....
0
 
LVL 2

Expert Comment

by:garfld
ID: 7182515
yes, well, i've used HS for years and it's the best. Nice clean code and easy to use. Highly recommend it.

But... do you think Macromedia will continue to support it as a standalone product?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 18

Expert Comment

by:bruno
ID: 7182558
I have no idea, but boy do i hope so.  i'd hate for it to disappear into dreamweaver somewhere.
0
 
LVL 1

Expert Comment

by:pagemastah
ID: 7185607
take brunobear's suggestion...

use a standard filename case. it can be UPPERCASE or lowercase. you choose...
0
 
LVL 1

Expert Comment

by:pagemastah
ID: 7185608
take brunobear's suggestion...

use a standard filename case. it can be UPPERCASE or lowercase. you choose...
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7271010
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 7273431
just cause i have no idea what ahoffman was talking about doesn't mean he wasn't right.

i still believe my idea would be the correct way to really fix the problem, take into account what i said above tho about ahoffman....  :-)
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7277367
my suggestion changes all HREF values to lower case in specified file (obvious, isn't it:)
0
 
LVL 18

Expert Comment

by:bruno
ID: 7278813
oohhhhh....now i don't see.   ;-)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7403186
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
split brunobear and ahoffmann

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

<observation> I think the user was looking for a way to do it with no work.  Both these solutions requires some work, but I dont' think there is a perfect solution.
</observation>

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 7404199
works for me.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7406275
agree too
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7431187
Per recommendation, force-accepted.

Netminder
CS Moderator

brunobear: http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_20394770.html
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now