程序报错:第8行then
附近有语法错误
#!/bin/bash
usagefunc () {
echo 用法: $0 Directory Day;
echo 例如: $0 `pwd` `date +%d`;
}
if [ $# -ne 2 ] ; then
usagefunc;
exit;
fi
#判断输入日期的第一个数字是否为零,若为零则去掉
if [ $2 = "01" ] ; then M=1; MONOK=1;
elif [ $2 = "02" ] ; then M=2; MONOK=1;
elif [ $2 = "03" ] ; then M=3; MONOK=1;
elif [ $2 = "04" ] ; then M=4; MONOK=1;
elif [ $2 = "05" ] ; then M=5; MONOK=1;
elif [ $2 = "06" ] ; then M=6; MONOK=1;
elif [ $2 = "07" ] ; then M=7; MONOK=1;
elif [ $2 = "08" ] ; then M=8; MONOK=1;
elif [ $2 = "09" ] ; then M=9; MONOK=1;
else M=$2; MONOK=1;
fi
if [ $MONOK = 1 ] ; then
ls -l -R $1 | grep -e "$M";
else
usagefunc;
fi