sqlplus prevent from executing until script is completed code example
Example: oracle executing sqlplus commands and waiting for completion
echo @scriptname | sqlplus username/password@connect
echo @scriptname | sqlplus username/password@connect