casperdaghost |
02-25-2012 04:22 PM |
using sed replace command with HTML brackets
I want to replace the angle brackets in this text.
Code:
<body>
<p>
Here is some normal text
</p>
<span class="bigText">Monster Text!</span>
<p>
Next to the big text
</p>
so i figures i would use the sed replace commands however it does not replae the while tag - I get <lt; - it is skipping the ampersand and retaining the angle bracket - not replacing it.
Code:
more more_body | sed -e 's/</</g'
<lt;body>
<lt;p>
Here is some normal text
<lt;/p>
<lt;span class="bigText">Monster Text!<lt;/span>
<lt;p>
Next to the big text
<lt;/p>
********
This is what I want it to look like :
Code:
<body>
<p>
Here is some normal text
</p>
<span class="bigText">Monster Text!</span>
<p>
Next to the big text
</p>
I want the less than angle brackets replaces with the the html entity - <
|