All pastes #270760 Raw Edit

Stuff

public shellscript v1 · immutable
·published 2006-12-07 18:16 UTC
rendered paste body
#a not so elegant, elegant solution to the issue of month rollover.day_tmp=`date +"%d"`month_tmp=`date +"%m"`if [ $day_tmp -eq 01 ]then        if [ $month_tmp -eq 01 ] || [ $month_tmp -eq 02 ] || [ $month_tmp -eq 04 ] || [ $month_tmp -eq 06 ] || [ $month_tmp -eq 08 ] || [ $month_tmp -eq 09 ] || [ $month_tmp -eq 11 ]        then        day=31        elif [ $month_tmp -eq 03 ]        then        day=28        elif [ $month_tmp -eq 05 ] || [ $month_tmp -eq 07 ] || [ $month_tmp -eq 10 ] || [ $month_tmp -eq 12 ]        then        day=30        fielse        day=$(( $day_tmp - 1 ))fi }