Useful listing of days in a month to populate directories or run scripts for backing up getting the correct dates of days in a month and year. YEAR=2020 MONTH=2 for DAY in $(DAYS=`cal $MONTH $YEAR | awk ‘NF {DAYS = $NF}; END {print DAYS}’` && seq -f ‘%02G’ $DAYS) ;do DATE=”$YEAR-$MONTH-$DAY” echo $DATE…
Get Days in a month from a bash script
Posted on