Search code examples
bashbrace-expansion

Exclude from brace expansion


I know that

echo {1..10}

do

1 2 3 4 5 6 7 8 9 10

but i do not want 6 and 7. Is it possible to exclude it?


Solution

  • It can be done with

    echo {1..5} {8..10}
    

    but One more solution I found:

    echo {{1..5},{8..10}}