#! /usr/bin/ksh
# ja fe ma ap ma ju ju ag se oc no de
set -A lasts 0 31 28 31 30 31 30 31 31 30 31 30 31
typeset -Z2 dmonth dday
#
# loop on years
year=2001
while ((year<2003)) ; do
#
# is this a leap year?
leap=0
if ((!(year%100))); then
((!(year%400))) && leap=1
else
((!(year%4))) && leap=1
fi
#
# set number of days in february
lasts[2]=28
((leap)) && lasts[2]=29
#
# loop on month
month=1
while ((month<13)); do
#
# loop on day
day=1
while((day<(lasts[month])+1)) ; do
dday=$day
dmonth=$month
echo ${year}${dmonth}${dday}
((day=day+1))
done
((month=month+1))
done
((year=year+1))
done
exit 0