Solved

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

Posted on 2004-08-18
11
2,154 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
  • 5
  • 3
11 Comments
 

Author Comment

by:raghava_dg
Comment Utility
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
Comment Utility
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
Comment Utility
Just to demonstrate:
# cat << ENDQ
>   aklöaslö
>  ENDQ
> ENDQ
  aklöaslö
 ENDQ
#
See?

-- Glenn
0
 

Author Comment

by:raghava_dg
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:raghava_dg
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
... 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
Comment Utility
PAQed - no points refunded (of 20)

Computer101
E-E Admin
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now