Help - Search - Members - Calendar
Full Version: Windows to Linux server conversion
Linuxhelp > Support > Technical Support
Jude
I hope this is not a beaten horse, but I cannot seem to find any information about it online...

...recently a friend moved his site from a windows server to a linux one based on the recommendation of his new shopping cart. The problem is that when he put his site together, many years ago, he used capital letters in the names of his directories and filenames. This is now causing tons and tons of broken links. Is ther a program or technique known that can help with this? Is the only option to go through all the lines of code manually changing upcase names to lowercase?

Any assistance is appreciated.

Jude
With already 30 people having looked and not responded to this topic I am beging to feel as if theere is no quick fix.

AM i correct in assuming that people are viewing this page in the hope that there is a link to a quick fix posted being that this is such a nightmare of a problem?
michaelk
It is very easy to create a simple bash script using sed for example that will perform a search and replace and you can find lots of help by googlng.
robert83a1


See this : http://webxadmin.free.fr/article/shell-ren...to-lowe-135.php

Sincerely
Robert B
Jude
QUOTE (robert83a1 @ Jun 24 2009, 04:43 AM) *


Thank you so much for the response. It looks to me like that program changes the file names. What i want to do is change the filenames IN the html code, not the actual file names. Is there anything that can do this?
Jude
QUOTE (michaelk @ Jun 23 2009, 05:57 PM) *
It is very easy to create a simple bash script using sed for example that will perform a search and replace and you can find lots of help by googlng.



A bash script? Sorry, I am new to this, is this something i could teach myself to do in a day? I did spend hours googling but foudn nothing so came here for help. Should I google Bash?
michaelk
for i in $(ls *.whatever); do sed 's/oldstring/newstring/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done

Basically this command will iterate the current directory for every file that matches *.whatever, replaces oldstring with newstring and creates a new file called filename-tmp
The original file filename is saved as filename-backup and the revised filename-tmp is renamed filename. Best to check this on some test files in a seperate directory.

Without knowing the distribution/version I assume your using bash. You can do this multiple times if there are more then one line that requires modification
Using a text editor.

#!/bin/bash
forfor i in $(ls *.whatever); do sed 's/oldstring/newstring/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done
for i in $(ls *.whatever); do sed 's/oldstring1/newstring1/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done
Jude
QUOTE (michaelk @ Jun 24 2009, 09:33 AM) *
for i in $(ls *.whatever); do sed 's/oldstring/newstring/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done

Basically this command will iterate the current directory for every file that matches *.whatever, replaces oldstring with newstring and creates a new file called filename-tmp
The original file filename is saved as filename-backup and the revised filename-tmp is renamed filename. Best to check this on some test files in a seperate directory.

Without knowing the distribution/version I assume your using bash. You can do this multiple times if there are more then one line that requires modification
Using a text editor.

#!/bin/bash
forfor i in $(ls *.whatever); do sed 's/oldstring/newstring/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done
for i in $(ls *.whatever); do sed 's/oldstring1/newstring1/g' $i > $i-tmp; mv $i $i-backup; mv $i-tmp $i; done



Thank, but I still dont think that this is the fix for my problem. It seems like this is still only changing filenames to lowercase AND NOT THE HTML CODE. The file naems have been changed already, ITS TEH HTML CODE THAT I WANT CHANGED. Can any help?
michaelk
It will change the file contents from oldtext to newtext.

http://en.wikipedia.org/wiki/Sed
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.