LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 11:15 AM   #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, 11:28 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
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, 03:01 AM   #3
valerio orfano
LQ Newbie
 
Registered: Dec 2010
Posts: 2

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

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Did the << EOF to <<EOF change fix it?
 
Old 12-29-2010, 06:16 AM   #5
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
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



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 07:19 PM
[bash] unexpected end of file waqasdaar Programming 6 04-03-2009 09:31 AM
'unexpected end of file' error saru06 Programming 2 08-09-2007 01:02 AM
Unexpected end of file??? raid517 Linux - Software 2 12-01-2004 04:10 AM
ACPI: Unexpected end of file h1tman Slackware 6 09-08-2003 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:10 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
Open Source Consulting | Domain Registration