Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (18 sloc) 357 Bytes
#!/bin/bash
YYYY=`date +%Y`
for i in `seq 1 12`
do
# 変数iが一桁の場合は先頭に"0"を追加する
[ ${i} -lt 10 ] && i="0"${i}
#月ごとに最終日を設定する
case ${i} in
"02") max=28;;
"04" | "06" | "05" | "09" | "11") max=30;;
*) max=31;;
esac
for j in `seq 1 ${max}`
do
[ ${j} -lt 10 ] && j="0"${j}
echo ${YYYY}${i}${j}
done
done