Help with Sed Command

Hello,

I have an XML file that I need to search all occurence of "http://159.107.180.219/atoss/handler/bin/" and "http://159.107.180.219/atoss/tas/IV\_SmokeTest/results/SMOKE\_TEST\_14\_04\_2008-11\_36_4" and generate a new file without the searched strings.

However, Im stucked in using sed for the script. Can you help me with the sed command to use for this script please?

Here is my sample HTML file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Test Results Index</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="http://159.107.180.219/atoss/handler/bin/squish-style.css"></head><a href="http://www.ccs.com"><img src="http://159.107.180.219/atoss/handler/bin/images/eLogo.gif" alt="css" height="62" width="143"></a><body><h1>Tests run on: 2008-04-14 - Priori
ty: 1</h1>
<h2>Suite: '$ATOSS_TA_HOME/IV_SmokeTest/tests' on host '127.0.0.1'</h2>
<ul>
<li>Test: <a href="http://159.107.180.219/atoss/tas/IV_SmokeTest/results/SMOKE_TEST_14_04_2008-11_36_43/2008-04-14_11.36.50_tests_tst_Test_127.0.0.1.html">tst
_Test[2008-04-14 11:37:52]</a>  Result: PASS <a href="http://159.107.180.219/atoss/tas/IV_SmokeTest/results/SMOKE_TEST_14_04_2008-11_36_43/2008-04-14_11.36.50_tests_tst_Test_127.0.0.1_VB.html">Full Report</a>
</ul>
</body>
</html>

The new file should have the following output:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<title>Test Results Index</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="squish-style.css"></head><a href="http://www.ccs.com"><img src="images/eLogo.gif" alt="css" height="62" width="143"></a><body><h1>Tests run on: 2008-04-14 - Priori
ty: 1</h1>
<h2>Suite: '$ATOSS_TA_HOME/IV_SmokeTest/tests' on host '127.0.0.1'</h2>
<ul>
<li>Test: <a href="2008-04-14_11.36.50_tests_tst_Test_127.0.0.1.html">tst
_Test[2008-04-14 11:37:52]</a>  Result: PASS <a href="2008-04-14_11.36.50
_tests_tst_Test_127.0.0.1_VB.html">Full Report</a>
</ul>
</body>
</html>

Thanks a lot in advance,

racbern

If your sed version support -i you can try:

sed -i .bak 's%http://159.107.180.219/atoss/tas/IV_SmokeTest/results/SMOKE_TEST_14_04_2008-11_36_43/%%g;s%http://159.107.180.219/atoss/handler/bin/%%g'  file