DilithiumMatrix
DilithiumMatrix

Reputation: 18677

bash brace expansion not working with zero padding or increment

using GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin12):

$ echo {1..10}
1 2 3 4 5 6 7 8 9 10

$ echo {01..10}
1 2 3 4 5 6 7 8 9 10

$ echo {1..10..2}
{1..10..2}

I get the same results if I put these into a script and run it as bash brace_test.csh

Why aren't zero-padding and explicit-increment working?

Upvotes: 2

Views: 942

Answers (1)

chepner
chepner

Reputation: 532418

Both zero padding and the step size were added in bash 4.

Upvotes: 5

Related Questions