Results 1 to 2 of 2

Thread: Unexpected end of file error encountered while running a shell script using bash

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Unexpected end of file error encountered while running a shell script using bash

    Hi All,

    I am trying to execute following 15 lines code in shell script using bash

    #---- Loader command
    while [ -f /hyperion/DF/lockfile_DF.lock ];
    do
    echo "The Script is running"
    sleep 5;
    done
    touch /hyperion/DF/lockfile_DF.lock
    sqlldr userid=ABC/XXX@XYZ Data=/hyperion/DF/TEST.txt control=/hyperion/DF/control_DF.ctl log=/hyperion/DF/logfile_DF.log;
    sqlplus ABC/XXX@XYZ<<EOF
    exec GEN_PIVOT_SQL_DF();
    exec Gen_Proc_SQL_DF();
    exit;
    EOF
    rm -f /hyperion/DF/lockfile_DF.lock
    rm -f /hyperion/DF/TEST.txt

    i encounter the error:
    DF_BUD.sh: line 16: syntax error: unexpected end of file

    Can anyone please point out what might be the issue.

  2. #2
    Member billconner's Avatar
    Join Date
    Jul 2010
    Posts
    90
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    5

    Default

    Quote Originally Posted by prsd View Post
    Hi All,

    I am trying to execute following 15 lines code in shell script using bash

    #---- Loader command
    while [ -f /hyperion/DF/lockfile_DF.lock ];
    do
    echo "The Script is running"
    sleep 5;
    done
    touch /hyperion/DF/lockfile_DF.lock
    sqlldr userid=ABC/XXX@XYZ Data=/hyperion/DF/TEST.txt control=/hyperion/DF/control_DF.ctl log=/hyperion/DF/logfile_DF.log;
    sqlplus ABC/XXX@XYZ<<EOF
    exec GEN_PIVOT_SQL_DF();
    exec Gen_Proc_SQL_DF();
    exit;
    EOF
    rm -f /hyperion/DF/lockfile_DF.lock
    rm -f /hyperion/DF/TEST.txt

    i encounter the error:
    DF_BUD.sh: line 16: syntax error: unexpected end of file

    Can anyone please point out what might be the issue.
    Get rid of the semi-colons ( in the while loop and try again. The end of file means something (like a quote) is opened but not closed.

    Bill

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Solved] Howto: Check to see if script is running as root in KSH/Bash shell
    By chinalinix in forum Shell scripting
    Replies: 6
    Last Post: 27th October 2011, 03:16 PM
  2. Replies: 3
    Last Post: 20th September 2011, 07:02 PM
  3. Bash unexpected EOF while looking for matching ``' Error
    By MikeLove in forum Shell scripting
    Replies: 4
    Last Post: 5th April 2011, 11:17 AM
  4. [Solved] .bash_profile error syntax error: unexpected end of file
    By shoboy in forum Shell scripting
    Replies: 7
    Last Post: 17th March 2011, 09:50 PM
  5. [Solved] Bash Script: unexpected end of file error
    By snowweb in forum Shell scripting
    Replies: 6
    Last Post: 21st April 2010, 02:09 PM

Posting Permissions

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