- 论坛徽章:
- 0
|
RQ=`date +20%y%m%d`
while true
do
clear
echo "\n\n\n\n\t\t\t\t清单打印"
echo "\n\n\t\t\t 1.查看当日发生额和笔数"
echo "\n\t\t\t 2.生成全辖清单"
echo "\n\t\t\t 3.生成yyy清单"
echo "\n\t\t\t 4.清除当日流水"
echo "\n\t\t\t 0.退出"
read ans
case $ans in
1) clear
echo "\n\n\t\t正在统计当日发生额和笔数,请稍等......"
db2 "select count(*),sum(tranamt) from trandetail"
echo "\n\n\t\t按回车继续!"
read ;;
2) clear
echo "\n\n\t\t正在生成当日汇总清单,请稍等......"
xreport $RQ 1
sleep 3
echo "\n\n\t\t生成成功,按回车继续!"
read ;;
3) clear
echo "\n\n\t\t正在生成yyy清单,请稍等......"
cd $HOME/runtime/report/
db2 "export to yyy$RQ.txt of del select * from trandetail "
vi $HOME/runtime/report/yyy$RQ.txt <<END 1>/dev/null 2>/dev/null
:0 r head
:%s/\"//g
:wq!
END
ftp -i -n yyy <<END 1>/dev/null 2>/dev/null
user jsrccbis xxxxxx
bin
put yyy$RQ.txt
bye
END
rsh yyy lp yyy$RQ.txt
exit
read ;;
4) clear
echo "\n\n\t\t正在清除当日流水,请稍等......"
xreport $RQ 3
cd $HOME/runtime/report
mv tob*.del T*.TXT ./tob
mv D* fin*.txt ./fin
read ;;
0) clear
exit;;
*) echo ;;
esac |
|