博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
记录拆花上shell
阅读量:3590 次
发布时间:2019-05-20

本文共 1496 字,大约阅读时间需要 4 分钟。

if [ -z "$1" ] ; then
echo "你没有输入执行该shell的参数"
exit;
fi
if [ "$1" != "jf" ] &&  [ "$1" != "jh" ] ; then
echo "请输入要上传的服务器名称:jf 经分,jh 稽核"
exit;
fi
CUR_YEAR=`date +"%Y"`
month=$(date "+%m"|sed '/^0/ s/0//')
permonth=`expr $month - 1`
month_len=`expr length $permonth`
if [ "$month_len" = "1" ]; then
v_month=0$permonth
elif [ "$month_len" = "2" ]; then
v_month=$permonth
elif [ "$permonth" = "0" ]; then
v_month=`12`
fi
LASTMONTH=${CUR_YEAR}${v_month}
#LASTMONTH=201202
#v_month="02"  
VALUE=`sqlplus -s chanxxxlzb/xxxx@chzzz<<EOF
set heading off;
set feedback off;
set pagesize 0;
set verify off;
set echo off;
select count(*)  from b_INFO_CLEAR_OWE where acct_month='${LASTMONTH}';
exit;
EOF`
echo "**************************";
echo $VALUE;
echo "**************************";
begin=1;
end=1000000;
file_seq=1;
temp=`expr $VALUE \% 1000000`
echo $temp
    
temp1=`expr $VALUE / 1000000`
if [ $temp -gt 0 ];  then
temp1=`expr $temp1 + 1`
fi
while [ $file_seq -le $temp1 ]
do
echo "第${file_seq}文件"
strfile_seq_1=`printf "%03d\n" $temp1` 
strfile_seq_2=`printf "%03d\n" $file_seq`
strfile_seq=${strfile_seq_1}${strfile_seq_2}
echo ${strfile_seq}    ${begin} ${end}
if  [ "$1" = "jf" ]; then
  exp_month_jf execsql exp_month_clear_owe file_seq ${strfile_seq}  begin ${begin} end ${end}
elif [ "$1" = "jh" ]; then
  exp_month_jh execsql exp_month_clear_owe file_seq ${strfile_seq}  begin ${begin} end ${end}
fi
sleep 1
begin=`expr $begin + 1000000`
end=`expr $end + 1000000`
file_seq=`expr $file_seq + 1`
strfile_seq="";
done

转载地址:http://vmvwn.baihongyu.com/

你可能感兴趣的文章
【c语言】蓝桥杯算法提高 三个整数的排序
查看>>
【c语言】蓝桥杯算法提高 P0101
查看>>
【c语言】统计字符次数
查看>>
CTDB原理介绍
查看>>
CTDB配置文件参数解析
查看>>
利用NFS共享搭建CTDB集群
查看>>
Python面向对象编程
查看>>
MAN QPIDD
查看>>
python import自定义模块
查看>>
Python利用XMLRPC实现分布式系统
查看>>
执行yum提示错误:rpmdb: BDB0113 Thread/process 424227/139826856310848 failed
查看>>
proftpd服务器搭建
查看>>
ProFTPD:Limit配置
查看>>
IDEA恢复布局
查看>>
重定向和请求转发的区别
查看>>
Map、Set、List集合区别(看完秒懂)
查看>>
普通用户使用docker命令遇到提示需要提升权限时的解决方法
查看>>
webpack打包技术
查看>>
Leecode 面试题09用两个栈实现队列
查看>>
fastdfs连接超时报错解决方案
查看>>