If [-z "$1"]; then
Echo "You did not enter the parameters for executing the shell"
Exit;
Fi
If ["$1 "! = "JF"] & ["$1 "! = "Token"]; then
Echo "enter the name of the server to be uploaded: JF score, audit by region"
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 \ % 100'
Echo $ temp
Temp1 = 'expr $ value/808080'
If [$ temp-GT 0]; then
Temp1 = 'expr $ temp1 + 1'
Fi
While [$ file_seq-Le $ temp1]
Do
Echo "File $ {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" = "Hangzhou"]; then
Exp_month_1_execsql exp_month_clear_owe file_seq $ {strfile_seq} begin $ {begin} end $ {end}
Fi
Sleep 1
Begin = 'expr $ begin + 1000000'
End = 'expr $ end + 100'
File_seq = 'expr $ file_seq + 1'
Strfile_seq = "";
Done