Advertisement

08.12.2008 at 09:08AM PDT, ID: 23641725 | Points: 500
[x]
Attachment Details

Script to replace a match

Asked by logic0004 in Bourne-Again Shell (bash), Scripting Languages

Tags:

Here is a sample log from apache:

[Mon Jul 28 00:02:35 2008] [error] [client 99.99.99.99] File does not exist: /home/abc.xyz.com/http/1.gif", referer: http://abc.xyz.com/ggg1/p0002.aspx?p=21sub..,,,

[Mon Jul 28 00:02:35 2008] [error] [client 99.99.99.99] File does not exist: /home/aac.xyz.com/http/1.gif", referer: http://abc.xyz.com/ggg1/p0002.aspx?p=21sub..,,,

I want to replace /home/abc.xyz.com/http.1.gif"  to http://abc.xyz.com/1.gif"

same way for the next line but in the log file it can be /home/anything/http/something

Any help is highly appreciated.Start Free Trial
[+][-]08.12.2008 at 09:16AM PDT, ID: 22214607

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2008 at 09:32AM PDT, ID: 22214731

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628