Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    unexpected end of file error

    Hi all,
    When I am trying to execute the file which I attached I am getting "XXJY_TEST_SANDY.prog: line 47: syntax error: unexpected end of file" error.

    Can someone please advice where I am doing wrong

    Any help is appreciated.

    Thanks in advance!!
    Attached Files Attached Files

  2. #2
    Just Joined!
    Join Date
    May 2011
    Austin, TX
    I believe the unexpected end of file is because you're reaching the (physical) end of file before exiting out of each sub-statement (in this case your first 'if' statement). "sqlplus" is never getting the EOF that it's expecting (after your EXIT; ), so the script is also passing everything else to sqlplus (and is still waiting for more data when it hits the end of the script).

    You told the script to redirect (<<) to sqlplus until it reaches "EOF", and it's never getting to EOF.

    Try this:
    cat << EOF
    > this
    > that
    > then
    > this
    > EOF

  3. #3
    Thanks for your reply,I figured it out but I have a doubt like many times when I copy some code from a working script and use it to testing,i encounter some strange issues like the one above "Unexpected end of file error" and "illegal token found".I had to enable some settings in editplus to view the extra tabs and substitute spaces instead of tabs.Is there any way that while copying some code the original formatting is not lost.

    Is there any editor which is advisable for shell scripting and even some suggestions of basic scripting

    Thanks in advance!!

  4. $spacer_open

Posting Permissions

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