Combinations of dates via printf?

Hi,

A friend showed my how to create a file that contains:

$0$0$0$0
$0$0$0$1
....
$9$9$9$9

with the line
printf '%s\n' $\{0..9}$\{0..9}$\{0..9}$\{0..9}

I now now needing to create a similar file that is all the combinations of:

$d$d$m$m

Where dd = days of month and months of year, ie dd = 01-31 and mm = 01-12
ie

$0$1$0$1 # first jan
$0$1$0$2 # second jan
..
$3$1$1$2 # 31st dec

I also want to create mmyy file (where yy = 00 to 99)

$0$1$0$1 # short date format for Jan 2000 or Jan 1900
...
$1$2$9$9 # short date format for Dec 1999

I assume I need a counter, but my bash isnt good enough to work in a counter.

Could someone please assist?

Many thanks

-Al
Sign In or Register to comment.