![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unexpected error | helpme2008 | UNIX for Dummies Questions & Answers | 2 | 05-04-2008 11:08 AM |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 08:16 AM |
| tar:read error: unexpected EOF | mikeruth | UNIX for Advanced & Expert Users | 4 | 01-18-2008 02:30 PM |
| tar: write error: unexpected EOF | jabe | UNIX for Dummies Questions & Answers | 4 | 12-05-2007 04:40 PM |
| tar: write error: unexpected EOF | vijayakumar.pc | Shell Programming and Scripting | 7 | 04-19-2007 08:41 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 sqlplus -s training1/training1 << EOF set serveroutput on; BEGIN DBMS_OUTPUT.PUT_LINE('IN SQL'); END; / quit; EOF done > file.txt IFS=$O; Can anyone help me |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
insert a "set -xv" in the second line of your script an run it. post the output from screen here...
|
|
#3
|
|||
|
|||
|
This is the output I got
-bash-3.00$ ./prog.sh O=$IFS; IFS=","; + O=' ' + IFS=, while read a b c d do echo $c sqlplus -s training1/training1 << EOF ./prog.sh: line 19: syntax error: unexpected end of file |
|
#4
|
|||
|
|||
|
I've noticed there's a space between << and EOF. Try removing it:
Code:
#!/bin/bash
O=$IFS; IFS=",";
while read a b c d
do
echo $c
sqlplus -s training1/training1 <<EOF
set serveroutput on;
BEGIN
DBMS_OUTPUT.PUT_LINE('IN SQL');
END;
/
quit;
EOF
done > file.txt
IFS=$O;
|
|
#5
|
|||
|
|||
|
I have tried but still its comming.
But the following code works #!/bin/sh sqlplus -s training1/training1 << EOF set serveroutput on; BEGIN DBMS_OUTPUT.PUT_LINE('File Open Error'); END; / EOF |
|
#6
|
|||
|
|||
|
the last done statement is as
done < file.txt |
|
#7
|
|||
|
|||
|
Ohhh I got it finally..but still count not locate the error in the first code....
Can anyone point it out.. #!/bin/bash O=$IFS; IFS=","; while read a b c d do echo $c sqlplus -s training1/training1 <<EOF set serveroutput on; BEGIN DBMS_OUTPUT.PUT_LINE('IN SQL'); END; / quit; EOF done < a IFS=$O; |
|||
| Google The UNIX and Linux Forums |