I have an index.html file which contain URLs. Example
<!-- UC -->
<A href="uc/live/current/index.html" >UC Live</A> 
<A href="uc/live/" >(All months)</A><br>
<!-- VI -->
<A href="vi/live/current/index.html" >VI Live</A> 
<A href="vi/live" >(All months)</A><br>
<!-- NQ-PRO -->
<A href="nq/live/current/index.html" >NQ Live</A> 
<A href="nq/live/" >(All months)</A><br>
</body>
</html>
I want to write script for automation so it will automatically add 3 lines of stanza above the </body> tag. for example I want to add following line above </body> tag. I believe we can use sed / awk to do that but don’t know how?
<!-- EX -->
<A href="ex/live/current/index.html" >EX Live</A> 
<A href="ex/live/" >(All months)</A><br>
Try the following simple
sedcommand (GNUsed)No need to use
/as delimiter, it can be what you want instead, here we have the separator@A PORTABLE SOLUTION
(tested on
Solaris 11,FreeBSD 8.0andArchlinux)