As indicated in Shell : while read line nested, you can just do something like
(sed "s|^|@${SQL_HOME}/update_p.sql |" ${LST_HOME}/doc.lst; echo exit) | sqlplus64 ${UserCoribudg}/${PassCoribudg}@${ORACLE_SID}
If you want to run a command after every SQL update, you could loop, although there are a number of caveats (globbing etc.). If the values in your doc.lst
are safe, you can do
while read line; do
(echo @${SQL_HOME}/update_p.sql ${line}; echo exit) | sqlplus64 ${UserCoribudg}/${PassCoribudg}@${ORACLE_SID}
/data/java_1.6_XX/bin/java -cp fr.bla.bla.bla
done < ${LST_HOME}/doc.lst
without needing to parse each line.
A safer option is to turn the whole file into a shell script:
sed "s|^|(echo @${SQL_HOME}/update_p.sql |" ${LST_HOME}/doc.lst | sed "s/$/; echo exit | sqlplus64/" | sed "s|$| ${UserCoribudg}/${PassCoribudg}@${ORACLE_SID}; /data/java_1.6_XX/bin/java -cp fr.bla.bla.bla|" > doc.script
sh doc.script