LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-28-2010, 12:15 PM   #1
valerio orfano
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: 0
Question unexpected end of file


i ve been struggling for 2 days now and cant figure out the soluton.

this is my whole script

sqlplus SIEBEL/SIEBEL@oltpsia << EOF
set serveroutput on size 1000000
set heading off
set feedback off
Insert into EIM_ZIPCODE_BADEIM (select sysdate, 'TOPONOMASTICA','','', c.* From EIM_ZIPCODE c where c.if_row_stat not in ('IMPORTED','DUP_RECORD_EXISTS'));
commit;
EXIT
EOF
#echo $?
if [ $? = 0 ]; then echo "OK" else echo "Errore" fi


the sql is properly executed but the if condition not, and i keep receiving the error message "unexpected end of file"

Where is the error, please help me out

BR valerio
 
Old 12-28-2010, 12:28 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,817

Rep: Reputation: 609Reputation: 609Reputation: 609Reputation: 609Reputation: 609Reputation: 609
Well, for starters,
Code:
sqlplus SIEBEL/SIEBEL@oltpsia << EOF
is invalid. Remove the space before EOF.

Also, is this bash, ksh, what?
 
Old 12-29-2010, 04:01 AM   #3
valerio orfano
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Original Poster
Rep: Reputation: 0
it's bash.
 
Old 12-29-2010, 05:12 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Did the << EOF to <<EOF change fix it?
 
Old 12-29-2010, 07:16 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,608

Rep: Reputation: 448Reputation: 448Reputation: 448Reputation: 448Reputation: 448
Quote:
Originally Posted by valerio orfano View Post
if [ $? = 0 ]; then echo "OK" else echo "Errore" fi


the sql is properly executed but the if condition not, and i keep receiving the error message "unexpected end of file"
You are missing a semicolon. Try


if [ $? = 0 ]; then echo "OK" else echo "Errore" ; fi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
yntax error: unexpected end of file sima h Linux - Newbie 2 08-02-2009 08:19 PM
[bash] unexpected end of file waqasdaar Programming 6 04-03-2009 10:31 AM
'unexpected end of file' error saru06 Programming 2 08-09-2007 02:02 AM
Unexpected end of file??? raid517 Linux - Software 2 12-01-2004 05:10 AM
ACPI: Unexpected end of file h1tman Slackware 6 09-08-2003 05:40 PM


All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration