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).
sedis your go-to guy for printing ranges of lines. You give it a starting/ending address or pattern and command to do between.The sort probably isn’t necessary because
lscan sort by name, but it might be good to include as a courtesy to maintainers to show the necessity. The-nto sed means “don’t print every line automatically” and the-emeans “I’m giving you a script on the command line”. I used ” to enclose the script to that$ENVVARwould be eval’d. The ending address is empty (//) and thepmeans “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 +2to start on the second line.