| | #1 |
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
Hey Warriors, Looks like my server has been hacked again. Ugh. Anyway, I need to get my hands on a recursive search and replace script in PHP or PERL. I could write one myself, but frankly, I'm sure there's a million of them out there. If you know of one with good documentation, please list it. I need to get this taken care of ASAP. Thanks. |
| | |
| |
| | #2 |
| Advanced Warrior War Room Member Join Date: 2009 Location: Cardiff, United Kingdom
Posts: 760
Thanks: 159
Thanked 144 Times in 99 Posts
|
Ultraedit has this. Can use regular expressions for the search and replaces. Not sure if it goes through multiple files though. Dreamweaver (you could always download the trial) definitely does go through all files in a folder, though. |
| Plagiarism Guard - Protect Against Content Theft
| |
| |
| | #3 |
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
I'm hoping to avoid reg exp, first of all because I want to shoot myself when I use them, and secondly it's one string that I need to remove from every file on my server. |
| | |
| |
| | #4 |
| Advanced Warrior War Room Member Join Date: 2009 Location: Cardiff, United Kingdom
Posts: 760
Thanks: 159
Thanked 144 Times in 99 Posts
|
You can use both UltraEdit's and Dreamweaver's search and replace normally (by string) too; I was just pointing out that they have powerful features (whereby you can use regexes) if needed. But yeah, they're both suitable for a simple search and replace |
| Plagiarism Guard - Protect Against Content Theft
| |
| |
| | #5 | |
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
P.S. Good on you for the Firefly avatar | |
| | ||
| |
| The Following User Says Thank You to Chris Ramsey For This Useful Post: |
| | #6 |
| VIP Warrior War Room Member Join Date: 2008 Location: Montreal Canada
Posts: 2,390
Thanks: 1,017
Thanked 836 Times in 572 Posts
Blog Entries: 1 |
UltraEdit would work great for this task. Another fine choice is PS Pad, unlike UltraEdit it's a free text editor (to be fair you can download a free trial of UltraEdit): editor PSPad - freeware HTML editor, PHP editor, XHTML, JavaScript, ASP, Perl, C, HEX editor Bill |
| |
| | #7 |
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
These sound good, but all the files are server-side, and I'd like to keep them there. So, if I can find something I can run via SSH, that would be best. That's why I'd like one in PHP or PERL. BASH may even work well. |
| | |
| |
| | #8 |
| VIP Warrior Join Date: 2005 Location: Potemkin Village
Posts: 1,724
Thanks: 745
Thanked 742 Times in 498 Posts
|
This is what I do: Code: find ./ -type f | xargs sed -i 's/What you want to find/Whatever you want to replace it with/g' |
|
:)
| |
| |
| | #9 |
| Warrior Member Join Date: 2009
Posts: 27
Thanks: 2
Thanked 2 Times in 2 Posts
|
I think I know what your problem is .... your PC is infected with a virus... Scan your entire PC with a good antivirus (QuickHeal,Avira) ...... also, some types of viruses delete the bottom part of the page.... so simple replacing may not work .... I use lacehost.com for hosting (do not go by their site design) and they really are very helpful in these matters ..... |
| |
| | #10 | |
| HyperActive Warrior War Room Member Join Date: 2002
Posts: 136
Thanks: 113
Thanked 44 Times in 36 Posts
|
Recursive search and replace (with a combination of bash, find and perl) (it's a tutorial with step by step info and code) HTH Carlos | |
| |
| | #11 | |
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
| |
| | ||
| |
| | #12 | |
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
I'll give this a shot real quick and see what happens. | |
| | ||
| |
| | #13 | ||
| The Wandering Businessman War Room Member Join Date: 2008 Location: The Globe
Posts: 1,417
Thanks: 161
Thanked 957 Times in 221 Posts
|
| ||
| | |||
| |
|
| Bookmarks |
| Tags |
| recursive, replace, search |
| |