The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-02-2009
welldone welldone is offline
Registered User
  
 

Join Date: Jun 2009
Posts: 11
shell script exiting before completing

I have a script which has the following statement,

/opt/oracle/product/9i/bin/sqlplus << EOC >> $LOG_FILE 2>&1
username/password ---- Enters the SQL prompt
@/export/home/oracle/shells/grant_userview.sql ---Runs the SQL script
@/export/home/oracle/shells/grant_proc_userview.sql ---Runs the SQL script
@/export/home/oracle/shells/createindex.sql ---Runs the SQL script
exit --- Exits the SQL prompt
EOC

imp system/password file=/oradata/temp/user.dmp fromuser=user 1 touser=user2 indexes=y log=user.log -- Runs on $ prompt.

The statement in red above doesnt run. When run out of the script manually it succeeds, I am trying to figure if i have to move this "exit" below the last line, Please advice