#! /bin/sh
year=$(date +%y)
month=$(date +%m)
premonth=$((month-1))
date=$(cal $premonth $year|xargs|awk '{print $NF}')
year=$(date +%Y)
premonth=$(printf "%02d" $premonth)
echo "$year-$premonth-$date"
echo "$year-$premonth-01"
year=$(date +%y)
month=$(date +%m)
premonth=$((month-1))
date=$(cal $premonth $year|xargs|awk '{print $NF}')
year=$(date +%Y)
premonth=$(printf "%02d" $premonth)
echo "$year-$premonth-$date"
echo "$year-$premonth-01"