Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: 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

  2. #2
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    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.

  3. #3
    Join Date
    May 2004
    Posts
    1

    Shivnarayan Varma

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

    Regards,
    Shiv

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •