|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Does anyone know of an app or script that handles global search and replace in the RedHat Linux operating system? I'm not having any luck finding one. I need to make a url change to about 300 html and cgi files and don't want to hose the file permissions by doing it in windows and replacing.
Thanks! |
|
#2
|
|||
|
|||
|
>>I need to make a url change to about 300 html and cgi files
Such script wouldn't be too difficult to write. Why didn't you use "include" in the first place? |
|
#3
|
|||
|
|||
|
I've just recently taken on this project well into development. Kind of new to dealing with unix.
I'm also not sure how productive your comment is. Did you intend to provide some sort of help? |
|
#4
|
|||
|
|||
|
>>I need to make a url change to about 300 html and cgi files
So I assume you have some kind of programming background. Perl? >>Did you intend to provide some sort of help? Definitely. "Why didn't you use "include" in the first place?" What I meant is if you or the original web developer used "include" to include the URL to those 300 files, it would save you time to update each file. |
|
#5
|
|||
|
|||
|
You should easily be able to do a global search and replace in Unix without PERL or anything. Unix excells at using regular expressions and manipulating text. Look at the man pages for sed (stream editor) for a starter. There are probably 50 methods for doing this, but if you go look at some Unix book in the bookstore, you should be able to find the Utility you want (Unix Power Tools might be a good place to start - that's a book title).
Cheers Tom |
|
#6
|
|||
|
|||
|
Thanks Tom, I'll take a look at that book. I actually did figure it out using sed. There's another cool command line utility I found called rpl.
|
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Global Search/Replace Linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|