Code:
#/bin/sh
adsts=`cat /tmp/flow_files/settings.dat | awk -F"," '{printf "EXEC CIM_MGMT_INSTALL1.addSetting(%c%s%c%c%c%s%c%c%c%s%c%c%s)\n",39,"Settings",39,44,39,"Settings",39,44,39,$1,39,44,1}'`
adflow=`cat /tmp/flow_files/flow.dat | awk -F"," '{printf "EXEC CIM_MGMT_INSTALL1.addFlow(%c%s%c%c%c%.1f%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%s)\n",39,$1,39,44,39,$2,39,44,39,$3,39,
44,39,"Settings",39,44,39,$4,39,44,39,$5,39,44,39,$6,39,44,$7}'`
addgp=`cat /tmp/flow_files/flow_group.dat | awk -F"," '{printf "EXEC CIM_MGMT_INSTALL1.addGroup(%c%s%c%c%c%s%c%c%s)\n",39,$1,39,44,39,$2,39,44,1}'`
adgpm=`cat /tmp/flow_files/flow_groupmap.dat | awk -F"," '{printf "EXEC CIM_MGMT_INSTALL1.addGroupMap(%s%c%c%s%c%c%c%s%c%c%s)\n",$1,44,39,$2,39,44,39,$3,39,44,1}'`
adsch=`cat addschedule.dat | nawk -F"," '{printf "EXEC CIM_MGMT_INSTALL1.addSchedule(%c%s%c%c%c%s%c%c%s%c%c%s%c%c%s%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%s%c%c%
s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c%c%c%s%c)\n",39,$1,39,44,39,$2,39,44,$3,44,39,$4,39,44,$5,44,39,$6,39,44,39,$7,39,44,39,$8,39,44,39,$9,39,44,39,$10,39,44,39,$11,39,44,39,$12,39,
44,39,$13,39,44,$14,44,39,$15,39,44,39,$16,39,44,39,$17,39,44,39,$18,39,44,39,$19,39,44,39,$20,39,44,39,$21,39}'`
result=`su - oracle -c "sqlplus oam/oam <<EOF
show user
$adsts
$adflow
$addgp
$adgpm
$adsch
EOF
" | egrep "successfully|ORA" | tr "\n" " " `
count=`echo $result | grep -i ora | wc -l`
if [ $count -eq 1 ]; then
echo $result
echo $count
fi