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 3853648
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:30:06+00:00 2026-05-19T17:30:06+00:00

Discount ‘s configure.sh script generates some dynamic comments at the start of the config.h

  • 0

Discount‘s configure.sh script generates some dynamic comments at the start of the config.h file:

/*
 * configuration for markdown, generated Fri 28 Jan 2011 16:13:46 EST
 * by tim@Orion.local
 */
#ifndef __AC_MARKDOWN_D
#define __AC_MARKDOWN_D 1

[...]

Which makes for some useless patches when embedding discount inside a git project, so I remove them before committing. I want to automate the output from configure.sh so I can upgrade discount inside the project quicker, but I’m not that well versed with awk/sed. I’ve got this line in my script:

tail -n +5 config.h > ../discount-config/config.h

But I’d like to replace this with something more future-proof, so it won’t mangle the file if later versions of discount have more/less than 4 lines of comments.

  • 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-05-19T17:30:06+00:00Added an answer on May 19, 2026 at 5:30 pm

    How about using sed?

    For example, if you can assume that the top comment will always start at the first line of the file:

    $ cat test.h
    /*
     * configuration for markdown, generated Fri 28 Jan 2011 16:13:46 EST
     * by tim@Orion.local
     */
    #ifndef __AC_MARKDOWN_D
    #define __AC_MARKDOWN_D 1
    
    /*
     * Test
     */
    
    int x;
    $ sed '1,/^ *\*\/ *$/ { d; }' test.h
    #ifndef __AC_MARKDOWN_D
    #define __AC_MARKDOWN_D 1
    
    /*
     * Test
     */
    
    int x;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use the Discount C-library to convert Markdown text into HTML. I
On a coupon site someone posted a shell script for finding Godaddy discount codes.
I have Total Amount Stored in Some Variable,Two TextBoxes, Discount Percentage Discount Amount that
Thanks in advance. how can i deduct some discount price from subtotal in view
I'm trying to add a div with some details of a discount coupon so
I know a website which provide me some service. I get an increasing discount
What is preferred way to add discount tags over some product image using css?
I have a simple promo code script to apply a discount to an amount
I have created some discount packages: Package1(Item1,Item2,Item5) Discount-5%. Package2(Item2,Item5,Item8) Discount-8% Package3(Item1,Item2) Discount3%. When a
My Discount model has one Period association. I am trying to write a scope

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.