YY=`date +%Y`
MM=`date +%m`
if [ "$MM" == "01" ]; then
MM=12
YY=`expr $YY - 1`
else
MM=`expr $MM - 1`
#对于经过计算后的一位数的月份,前面补0
if [ $MM < 10 ]; then
MM="0$MM"
fi
fi
file=$YY$MM.xml
echo "info: searching $file ..."
cd /portal/shell/billInfo/bill/WHbillXMLView
if [ ! -f "$file" ]; then
echo "error: the source bill file $file does not exist"
else
dir="/portal/applications/hkweb/WEB-INF/billfile/3Gbill/$YY$MM"
if [ ! -d $dir ]; then
echo "info: now reading $file"
cd /portal/shell/billInfo
java -cp saxon.jar:saxon-jdom.jar:bill.jar TestdirectSubxml
echo "info: $YY$MM is successfully accomplished"
else
echo "error: $YY$MM is accomplished last time!"
fi
fi