Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:51:11+00:00 2026-06-12T17:51:11+00:00

I have an index.html file which contain URLs. Example <!– UC –> <A href=uc/live/current/index.html

  • 0

I have an index.html file which contain URLs. Example

    <!-- UC -->
        <A href="uc/live/current/index.html" >UC Live</A>&nbsp
        <A href="uc/live/" >(All months)</A><br>
    <!-- VI -->
        <A href="vi/live/current/index.html" >VI Live</A>&nbsp
        <A href="vi/live" >(All months)</A><br>
    <!-- NQ-PRO -->
        <A href="nq/live/current/index.html" >NQ Live</A>&nbsp
        <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>&nbsp
        <A href="ex/live/" >(All months)</A><br>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:51:12+00:00Added an answer on June 12, 2026 at 5:51 pm

    Try the following simple sed command (GNU sed)

    sed 's@</body>@\t<!-- EX -->\n\t<A href="ex/live/current/index.html" >EX Live</A>&nbsp;\n\t<A href="ex/live/" >(All months)</A><br>\n</body>@'
    

    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.0 and Archlinux)

    sed 's@</body>@  <!-- EX -->\
            <A href="ex/live/current/index.html" >EX Live</A>&nbsp;\
            <A href="ex/live/" >(All months)</A><br>\
    </body>@' file.html
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an index.html file which I want to run some jQuery when it
I have an html file index.html (in my server say abc.com) which accesses xyz.js
I have Javascript function defined in the main index.html file. One part of this
I have an upload script that write a index.html file, I modified it to
I have a PHP script (index.php) that includes an index.html file in a sub-directory
I have a template in joomla without index.php I only have index.html, css file,
I have activated the IIS package for windows, and, I created an index.html file
Absolute beginner question: I have a template file index.html that looks like this: ...
I have the following file structure: |- index.html vendor |- jquery.min.js (some libraries) js
i am using php 5.2.8 i have index.html, which loads LOAD.PHP from IFRAME. iframe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.