Unclosed EOF (error)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Unclosed EOF (error)
# 1  
Old 12-06-2009
Unclosed EOF (error)

I have a script which throws an error: "here document `EOF' unclosed"
The script is:

Code:
...
main() 
{
   
 RETVAL=`sqlplus -s $ConnectDetails << EOF 
 SET SERVEROUTPUT ON
 DECLARE
    errnum      NUMBER;
    errmsg      VARCHAR2(1000);
 BEGIN
     My_Procedure( errbuf  => errmsg, errcode => errnum );
 END;
 /
 exit;
  
 EOF`
 echo $RETVAL
 ...
 ...
 }
 ...

When I run this manually via command line, it runs fine. When invoked through cronjob, it throws this error... any idea why??
Thanks in advance.
# 2  
Old 12-07-2009
Because the closing EOF is indented.
# 3  
Old 12-07-2009
Thank you very much! It is working now... You made my Monday!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error with EOF when used in function

Hi all I am inserting record in oracle database using shell script. When the sql part is directly written in the shell script the record is getting inserted. But when the same piece of code is added into a function, I am getting an error while execution "line 45: syntax error: unexpected end of... (6 Replies)
Discussion started by: sudeep.id
6 Replies

2. UNIX for Advanced & Expert Users

tar: write error: unexpected EOF

tar: write error: unexpected EOF I usually encounter this when I'm doing backup to Dat72 tape. Here's the command gzip all files in a directory then tar cvfp /dev/rmt/0n files. Not all files are copied. Any things I should look at? Directory size? ---------- Post updated at 05:20 PM... (1 Reply)
Discussion started by: lhareigh890
1 Replies

3. Shell Programming and Scripting

[Solved] <<EOF error checking

I am trying to check the return status of a command thats encapsulated in an <<EOF #!/bin/ksh set -x xxx() { set -x ls -lt /tmp/jdlkewjdlkewjdlkewjdlewjdlew<<EOT ret=$? EOT echo "ret=$ret" } >>$LOG 2>&1 LOG=/tmp/t2.out rm -rf $LOG echo "Starting process `date... (2 Replies)
Discussion started by: BeefStu
2 Replies

4. Shell Programming and Scripting

Oracle Shell script | here document `EOF' unclosed

Hi folks I m creating script which is give me below error. $ ./function.ksh ./function.ksh: here document `EOF' unclosed Inside the script is #!/bin/ksh export ORACLE_SID=OECDV1 export ORACLE_HOME=/u01/app/oracle/product/10.2.0 export PATH=$ORACLE_HOME/bin:$PATH echo "sql is... (3 Replies)
Discussion started by: tapia
3 Replies

5. Shell Programming and Scripting

help pls getting EOF error

#!/bin/bash while : do clear echo ""***************************************" echo "* - MAIN - MENU - *" echo "***************************************" echo "* 1. Directory Listing *" echo "* 2. Users Currently Logged In *" echo "* 3. Create a... (2 Replies)
Discussion started by: celtic123
2 Replies

6. Shell Programming and Scripting

here document `EOF' unclosed

I am trying to assign the value in variable using below command. exp_stat=`sqlplus -silent USER_NAME/PWD <<EOF set pagesize 0 feedback off verify off heading off echo off select count(*) from TABLE_NAME; exit; EOF` But getting the below error. here... (2 Replies)
Discussion started by: gander_ss
2 Replies

7. UNIX for Advanced & Expert Users

tar:read error: unexpected EOF

I need archive data from some tar files. I use the command "tar xvf filename". For about half of the files I get the error message "tar:read error: unexpected EOF". The number of bytes extracted comes very close to the size of the tar file. An example: 972434779 Jan 10 01:01... (4 Replies)
Discussion started by: mikeruth
4 Replies

8. Shell Programming and Scripting

Unexpected eof error

Hi, I am newbie and am just trying to connect to oracle from shell script ,,,but I am getting the following error ./prog.sh: line 20: syntax error: unexpected end of file The scripts is : #!/bin/bash O=$IFS; IFS=","; while read a b c d do echo $c ... (6 Replies)
Discussion started by: thana
6 Replies

9. UNIX for Dummies Questions & Answers

tar: write error: unexpected EOF

I am taring to disk and get this message: tar: write error: unexpected EOF This message is normally associated with tape devices, not disk. Here is the syntax: tar -cf <tarfilename> /dir Have you seen this message on disk tars? (4 Replies)
Discussion started by: jabe
4 Replies

10. Shell Programming and Scripting

tar: write error: unexpected EOF

Hi friends, I am using Sun Solaris 5.9. I want to take backup of 3 folders which are 50 GB in size totally using tar command on tapes. I am having DAT 72 tape. After initiating tar command (tar -cvf /dev/rmt/0n /tmp/dir1/ /tmp/dir2/ /tmp/dir3/), tarring is stopped after 10 hrs (approx) and i am... (7 Replies)
Discussion started by: vijayakumar.pc
7 Replies
Login or Register to Ask a Question