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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:41:51+00:00 2026-05-26T18:41:51+00:00

I have files like update-1.0.1.patch update-1.0.2.patch update-1.0.3.patch update-1.0.4.patch update-1.0.5.patch And I have a variable

  • 0

I have files like

update-1.0.1.patch
update-1.0.2.patch
update-1.0.3.patch
update-1.0.4.patch
update-1.0.5.patch

And I have a variable that contains the last applied path (e.g. update-1.0.3.patch). So, now I have to get a list of files to apply (in the example updates 1.0.4 and 1.0.5). How can I get such list?

To clarify, I need a method to get a list of files that comes alphabetically later of given file and this list of files must be also in alphabetical order (obviously is not allways possible to apply the patch 1.0.5 before 1.0.4).

  • 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-26T18:41:51+00:00Added an answer on May 26, 2026 at 6:41 pm

    sed is your go-to guy for printing ranges of lines. You give it a starting/ending address or pattern and command to do between.

    ls update-1.0.* | sort | sed -ne "/$ENVVAR/,// p"
    

    The sort probably isn’t necessary because ls can sort by name, but it might be good to include as a courtesy to maintainers to show the necessity. The -n to sed means “don’t print every line automatically” and the -e means “I’m giving you a script on the command line”. I used ” to enclose the script to that $ENVVAR would be eval’d. The ending address is empty (//) and the p means “print the line”.

    Oh, and I just noticed you only want the ones later. There’s probably a way to tell sed to start on the line after your address, but instead I’d pipe it through tail -n +2 to start on the second line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some files that I'd like to delete the last newline if it
I have a solution that contains several c# projects and I would like to
I have patch file describing changes to multiple files to apply to the contents
I have files served like so: AJAX request handler -> Include file I would
We have multiple log files like database log, weblog, quartzlog in our application. Any
In a project we have text files looking like this: mv A, R3 mv
Possible Duplicate: Regex for matching javadoc fragments I have files having content like /**
I have a few log files like these: /var/log/pureftpd.log /var/log/pureftpd.log-20100328 /var/log/pureftpd.log-20100322 Is it possible
I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php
In my application, I have a provision for users to upload files like doc,

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.