stringbashbrace-expansion

Regexp and String manipulation in BASH


How can I rewrite this command:

ls access-19{01,02,03,04,05,06,07,08,09,10,11,12}*.log

which is working.

To a form like this:

ls access-19{$(seq -ws',' 01 12)}*.log

which is not working.


Solution

  • With brace expansion:

    ls access-19{01..12}*.log