This will work in any shell on a machine that has coreutils installed (thanks commenters for correcting me):
seq -w 1 10
and
seq -w 1 100
Explanation:
- the option
-wwill:
Equalize the widths of all numbers by padding with zeros as necessary.
seq [-w] [-f format] [-s string] [-t string] [first [incr]] last
prints a sequence of numbers, one per line (default), from
first (default 1), to near last as possible, in increments of incr (default
1). When first is larger than last the default incr is -1