1:
premonth=`date +%Y%m|awk '{s=$1-1; if (substr($1,5,2)=="01") s=s-88; print s}'`
2: 判断输入参数的例子:
ARGS=2
E_BADARGS=65
if [ $# -ne "$ARGS" ]
then
echo "Usage: `basename $0` yearmonth(yyyymm) day(dd)"
# 或者 echo "Usage: $0 yearmonth(yyyymm) day(dd)"
exit $E_BADARGS
fi
阅读(1257) | 评论(0) | 转发(0) |