bash - Exit from the oracle user session when running a script -


I have a problem with a bash script on a Ubuntu system. I need to do a script program that will send some text files to some queries Connects to Oracle to spell out

Nearly all of the tasks have been completed, but the script does not run because it should be.

To generate connections to Oracle, I use the following lines inside my script: P>

  export oracle export ORACLE_SID = DB_SID export ORACLE_HOME = [ORACLE_PATH] ] Export TWO_TASK = [HOSTNAME: PORT] Export Pat = $ ORACLE_HOME / bin: $ PATH sqlplus -s usr / pass & lt; & Lt; EOF   

Later in the lines I spooling all of the data and finally use the following lines to exit sqlplus:

  Quit;   

To disconnect from sqlplus

  exit   

To exit Su Oracle session

  eof   

and after the IOF tag I put some other commands to execute.

The problem occurs when I run my script:

  users # sh MyScript.sh   

do all the tasks Instead, only the script & lt; & Lt; The control of the EOF and I return terminal is still logged in as Oracle user.

  oracle @ user #   

If I type 'exit' and press enter then the rest of the script is executed.

I need a script to start without this middle step, but I do not know how.

Thanks in advance.

Finally, it is not wise to use [O Oracle] to export the environment variable , So I have only removed the line:

And the process works like a charm.

Thanks to all those who help.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -