If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Exiting out of Shell script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-04, 16:02
dennis_allan dennis_allan is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
Exiting out of Shell script

Hello,
I have a Bourne Shell script that first calls sqlldr then logs into SQL Plus to run a PL/SQL script. However, when I run this script, I need to type in 'exit' or <ctrl-d> to get back to the prompt. I would like to be able to run the script and have the cursor return automatically. Here is my script:
#!/bin/sh
sqlldr <usrname>/<pw> control = control.ctl
sqlplus -s <username>/<pw> @script3.txt
exit
EOF

Any help is appreciated. Thanks.

Dennis
Reply With Quote
  #2 (permalink)  
Old 04-20-04, 01:50
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
First solution, use HERE document :
Code:
#!/bin/sh
sqlldr <usrname>/<pw> control = control.ctl
sqlplus -s <username>/<pw> @script3.txt <<EOD
exit
EOF
Second solution (the best one), redirect stdin to /dev/null :
Code:
#!/bin/sh
sqlldr <usrname>/<pw> control = control.ctl
sqlplus -s <username>/<pw> @script3.txt </dev/null
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 05-01-04, 10:40
shivnarayan shivnarayan is offline
Registered User
 
Join Date: May 2004
Posts: 1
Shivnarayan Varma

Thanx for this post. This has solved my problem also.

Regards,
Shiv
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On