记录拆花上shell
来源:互联网 发布:台风海燕 知乎 编辑:程序博客网 时间:2024/05/22 08:22
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
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
- 记录拆花上shell
- shell 记录
- shell记录
- shell记录
- shell记录
- shell记录
- shell记录
- shell处理字符串记录
- shell记录时间
- shell常错记录
- shell的一些记录
- shell学习记录---1
- shell学习记录---3
- shell学习记录---4
- shell学习记录---5
- shell学习记录---6
- shell学习记录---7
- shell使用记录
- Python中的getattr()函数 (二)
- 51单片机片外扩展RAM
- 一个孤立的信息和一个相关的信息库信息网
- vc++ CString转换
- 为什么我们的学校总是培养不出杰出人才
- 记录拆花上shell
- TLC5615 10位D/A转换器
- 算法导论 逆序对问题
- TLC1549驱动 10位A/D转换器
- SQL 连接 JOIN 例解。(左连接,右连接,全连接,内连接,交叉连接,自连接)
- DBA手记:X$KTUXE与Oracle的死事务恢复
- 转:利用HTTP_X_FORWARDED_FOR获取客户端IP(http代理的相关知识)
- NHibernate---用criteria做分页出问题
- HT1380/1381(DS1302)驱动