[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

syntax error at line 149: `end of file' unexpected

Posted on 2004-08-18
11
Medium Priority
?
2,176 Views
Last Modified: 2008-02-01
Hi ,

I am cought up in a strange error . I am getting  syntax error at line 149: `end of file' unexpected
when I try to run a script.
Strange thing is the line it says is not present in the file . I am going crazy from past 2 days .
any 1 please give some suggetions.



here is the code . I came to know that these , the line with $ISQL is giving prob. If i comment out thaat line then syntax error is going off .


            $ISQL << _ENDQ | egrep -v -e "^      NodeName |^ ---"> $STARTCSRIPT
            $DB_PASSWD
            use $REF_DB
            go
            set nocount on
            go

            select * from table
            go

            _ENDQ


Thanks
Raghava
0
Comment
Question by:raghava_dg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
11 Comments
 

Author Comment

by:raghava_dg
ID: 11836137
Thanks ..... , Never mind on this qtn guyz.
I found the answer.

Solution :

never ever leave a space while u connecting to ISQL . i,e start from the first column of the line ,don't  use space or tab in the begining of the line.


Thanks
Raghava
0
 
LVL 20

Expert Comment

by:Gns
ID: 11840037
It's actually the "here document" that is giving you grief... The ENDQ label needs come smack first on the line. So what you were seeing was a "runaway here document".

-- Glenn (not expecting points for this, just thought you'd like to know;-)
0
 
LVL 20

Expert Comment

by:Gns
ID: 11840059
Just to demonstrate:
# cat << ENDQ
>   aklöaslö
>  ENDQ
> ENDQ
  aklöaslö
 ENDQ
#
See?

-- Glenn
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:raghava_dg
ID: 11849113
Thanks Glen ,

But what do you mean by " here document " ? I did not understand.  Can you send me any link where can I get little knowledge abt this ?

Thanks
Raghava
0
 

Author Comment

by:raghava_dg
ID: 11849132
I will  not give points to any one .

Moderator ...Please let me know how to close this qtn without granting the points .
0
 
LVL 20

Expert Comment

by:Gns
ID: 11850932
HERE DOCUMENT is the name of the construct by which you "redirect" text from the start label unto the endlable _from the same "file" as the shell is reading the script. As I demonstrate this can be used with any command to which you can redirect input ... In the example it is the "cat" command.
As you can see in the example (you can try it at the shell prompt! An interactive shell reads its commands from the "stdin" file;-) Both the line "  aklöaslö" and the line " ENDQ" is interpreted as being part of the input... the shell only sees the "ENDQ" line as the "ending label".
Since "here documents" are part of the shell, they are documented in the shells manpage. So do read the manpage for your shell (be it sh, ksh, bash, zsh, csh, tcsh ....:-). If you don't know how to use the man command, the pages are available at several places on the net... I like the ones you can find on http://www.tldp.org ;-)

You can contact Community Support to have them handle this if Achim fails to see it... Just place a 0 point question (with a link back here) in that TA.
... We're slowly working away from 0-points here, don't you think:-).

-- Glenn
0
 
LVL 20

Expert Comment

by:Gns
ID: 12082222
Well... Perhaps never really took off from "0-point quality":-).
My only reason for commenting was to adjust the reasoning as to why the fix discovered by the questioner worked, so I've got no real, nor imaginary, objections:-):-)

-- Glenn
0
 
LVL 20

Expert Comment

by:Gns
ID: 12101467
... And there we see how much points merit in my choice regarding commenting or not:-). I hadn't even looked at that.
You've of course got the right of it jmcg.

-- Glenn
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 12117774
PAQed - no points refunded (of 20)

Computer101
E-E Admin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question