Can I use seq to go from 001 to 999?
Yes using the -w
parameter:
-w, --equal-width
equalize width by padding with leading zeroes
e.g.
seq -w 0 999
gives
000
001
...
999
This will work in any shell on a machine that has coreutils installed:
seq -w 1 10
and seq -w 1 100
Source: https://stackoverflow.com/questions/11891162/bash-sequence-00-01-10
seq
- a duplicate of a question specifically aboutbash
brace expansion? The two are not the same. – mikeserv Aug 30 '14 at 2:57