#!/bin/bash
#created on 20090305 by lry
stat_month=$1
tmpdate=`date '+%Y%m'`
if [ -z $stat_month ]
then
echo "请输入账务月(默认为当前月)[$tmpdate]:"
read stat_month
echo "执行当月 ${stat_month:=$tmpdate} OK"
fi
NUM=`ls CALLEDXXXX_${stat_month}*.sccd.*.gz | cut -d '.' -f 3`
f=0
ff=0
for seq in $NUM
do
if [ $f -eq 0 ]
then
t_seq=$seq
f=1
else
diff=`expr $seq - $t_seq`
if [ $diff -ne 1 ]
then
echo "$seq和$t_seq之间差文件"
ff=1
fi
t_seq=$seq
fi
done
if [ $ff -eq 0 ]
then
lastfile=`ls CALLEDXXXX_*.sccd.$seq.gz | cut -d '.' -f 1 | cut -c18-19`
echo "这个月直到$lastfile号不差文件"
fi