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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:38:57+00:00 2026-05-26T20:38:57+00:00

How do I get make to generate a list of prerequisites in numerical order?

  • 0

How do I get make to generate a list of prerequisites in numerical order? I want to do something like this:

cat file1 file2 file10 file11 file21 | script

When I try this in a bash shell and in the Makefile:

cat file* | script

the files are used in the order file10 file11 file1 file21 file2
which is not what I want. In bash I can force the issue like this:

cat file{[0-9],[0-9][0-9]} 

and similar tricks. But I do not know how to get make to recognize these wildcard options and I get many errors when I try to put variations of this in my Makefile:

target: file{[0-9],[0-9][0-9]}
        cat $^ | script

Obviously I do not want to list each file individually, I have shown only a few as an example, there are hundreds, and yes, there are gaps. So how do I get a nice make recipe that will use my files nicely in numerical order? (I could rename all the files from [digit] to 0[digit], but that seems like wimping out and avoiding the issue!)

  • 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-26T20:38:58+00:00Added an answer on May 26, 2026 at 8:38 pm

    This might work for you:

    # mkdir test
    # cd test
    # touch test{a,b}{9..11}.txt
    # echo *
    testa10.txt testa11.txt testa9.txt testb10.txt testb11.txt testb9.txt
    # echo $(ls -v *)
    testa9.txt testa10.txt testa11.txt testb9.txt testb10.txt testb11.txt
    # echo testa*
    testa10.txt testa11.txt testa9.txt
    # echo $(ls -v testa*)
    testa9.txt testa10.txt testa11.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have something like this public class Reminders() { public List<SelectListItem> Reminder { get;
So i have this ArrayList: list.get(0) == love list.get(1) == foo list.get(2) == make
So GET forms make the usual urls like .../search/?q=apple Can you make a form
I can not get to make this comparison in this simple code error ..
How do I get to make this sqsl query work: SELECT student.LASTNAME, student.FIRSTNAME, student.IDNO,
I am trying to generate functions using a macro: (defmacro make-my-emacs-command-region (cmd name) (list
I would like to generate a TSV file from a list of vehicles....I'll also
I have got four routes defined like this: //Project list with page number routes.MapRoute(
The ViewModel looks like this: public W { get; set; } public WC WC
I am using the following code to get make an IMAP connection. I am

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.