Can I use seq to go from 001 to 999?
Asked
Active
Viewed 5,146 times
3
-
3The answer is in [the man page](http://man.cx/seq) – glenn jackman Aug 29 '14 at 19:28
-
1How is this question - which is specifically about the command `seq` - a duplicate of a question specifically about `bash` brace expansion? The two are not the same. – mikeserv Aug 30 '14 at 02:57
2 Answers
9
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
Renan
- 16,976
- 8
- 69
- 88
3
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