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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:48:22+00:00 2026-06-05T09:48:22+00:00

I have a inputfile with template as shown below. I want to change the

  • 0

I have a inputfile with template as shown below. I want to change the Version: using sed.

    Package: somename
    Priority: extra
    Section: checkinstall
    Maintainer: joe@example.com
    Architecture: i386
    Version: 3.1.0.2-1
    Depends:
    Provides: somename
    Description: some description

Currently I am getting the current version using grep -m 1 Version inputfile | sed 's/[:_#a-zA-Z\s"]*//g' and I am trying to replace the current version with sed 's/3.1.0.2-1/3.1.0.2/' inputfile

However this does not seem to work, but when I try it in command line using echo it works.
echo 'Version: 3.0.9.1' | sed 's/3.0.9.1/3.2.9.2/'

Output: Version: 3.2.9.2

Any help on how I can accomplish this would be appreciated. Preferably I would like to change the version without getting the current version in the file.

Thanks In Advance

  • 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-05T09:48:24+00:00Added an answer on June 5, 2026 at 9:48 am

    You don’t need the grep.

    sed -i '/Version/s/3\.1\.0\.2-1/3.1.0.2/' <files>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think we already have similar post using sed to add text at the
I have created a custom editor template for input file in MVC3. I want
I have to show the filenames using given template. I've written the following code:
Have a SomeLib.pro file that contains: CONFIG += debug TEMPLATE = lib TARGET =
I have a file inputfile <input tye='file' id='funPic' name='funPic' /> I need to get
In my aspx page I have a HTML inputfile type which allows user to
I have a simple function that sorts a dictionary: data = inputfile.readlines() lineData =
I have a PDF document that I just received via file upload (InputFile). I'd
I have a problem and a question with using Strings. The problem I am
everyone! I have a 2D vector filled with unsigned chars. Now I want to

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.