Enviado em 23/04/2017 - 20:30h
Pessoal, alguém poderia me ajudar pq ele cai direto no primeiro IF mesmo que eu diga que o processo é TESTE00FI?echo "PROCESSO:"
read id_processo
if [ ${id_processo:11:2}="WI" ]; then
echo "FOLDER_TAM:"
read folder
echo ""
echo "STAGE"
read stage
echo ""
echo "TABELA ADABAS"
read table
echo ""
echo "FN:"
read fn
echo "Unix: WI"
echo -e "nohup execods ODS1S000019CE \&\n"
echo -e "nohup execods $id_processo \&\n"
echo -e "nohup execods ODS1S000020CE"
echo ""
echo "TB_PROCESSO:"
echo "INSERT INTO TB_PROCESSO VALUES( '$id_processo', '$id_processo','Carga da stage $stage',NULL,11,${id_processo:7:4}, NULL,'$folder','1S', SYSDATE, 'S');"
echo ""
echo "CT_OPCOES_PWX:"
while ((${#fn}<4));do
fn=$(sed 's/^/0/' <<< "$fn")
done
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'DF','SAC_DF0122F$fn','PWX_NRDB_R2_CEN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'GO','SAC_GO0122F$fn','PWX_NRDB_R2_CEN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'MS','SAC_MS0122F$fn','PWX_NRDB_R2_CEN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'MT','SAC_MT0122F$fn','PWX_NRDB_R2_CEN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'AC','SAC_AC0122F$fn','PWX_NRDB_R2_PRN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'RO','SAC_RO0122F$fn','PWX_NRDB_R2_CEN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'SC','SAC_SC0122F$fn','PWX_NRDB_R2_SUL',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'RS','SAC_RS0122F$fn','PWX_NRDB_R2_PRN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'CR','SAC_CR0122F$fn','PWX_NRDB_R2_PRN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'PR','SAC_PR0122F$fn','PWX_NRDB_R2_PRN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'CO','SAC_CO0122F$fn','PWX_NRDB_R2_PRN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'FR','SAC_FR0122F$fn','PWX_NRDB_R2_PRN',SYSDATE,SYSDATE,'$table');"
echo "INSERT INTO CT_OPCOES_PWX VALUES($id_processo,'BR','SAC_BR0122F$fn','PWX_NRDB_R2_SUL',SYSDATE,SYSDATE,'$table');"
echo ""
elif [ ${id_processo:11:2}="FI" ]; then
echo "Unix: WI"
echo ""
echo -e "nohup execods ODS1S000019CE \&\n"
echo -e "nohup execods $id_processo \&\n"
echo -e "nohup execods ODS1S000020CE"
fi