Solved

k shell syntax error..

Posted on 2009-04-07
10
522 Views
Last Modified: 2013-12-27
Hi

I have the following code in k shell that errors..
#!/bin/ksh
 sqlplus -s /nolog <<EOF > $MYFOLDER/logs/spool_file.log
  set serveroutput on
  start $HOME/connect_oracle
  execute mypack.procedure($SOURCE,$OUTPUT)
  exit
  EOF

and I have the error
myshell[2]: syntax error at line 2 : `<<' unmatched

I tried to get /cut space before EOF or after EOF and still does not work.. could not figure out what is wrong.. I am running in solaris box..
0
Comment
Question by:mahjag
[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
  • 5
10 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 24090791
Do you have space before the closing END ? From what you posted I could see that you have. remove it or use

sqlplus -s /nolog <<-EOF > $MYFOLDER/logs/spool_file.log


0
 

Author Comment

by:mahjag
ID: 24091037
I tried to not have space after EOF and still the same syntax error

I tried sqlplus -s /nolog <<-EOF > $MYFOLDER/logs/spool_file.log
and still same syntax error..
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24091141
if you notice I said before the closing END (at the last line)
how you edit the script file? are you transferring it from  windows?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mahjag
ID: 24091160
using vi editor in unix
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24091203
is it working now?
0
 

Author Comment

by:mahjag
ID: 24091204
and I checked there is no space after the last line
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 24091232
I say a gain , before END not after it. you may cut and paste from below

#!/bin/ksh
sqlplus -s /nolog <<EOF > $MYFOLDER/logs/spool_file.log
set serveroutput on
start $HOME/connect_oracle
execute mypack.procedure($SOURCE,$OUTPUT)
exit
EOF
0
 

Author Comment

by:mahjag
ID: 24091274
what do you mean by END? the last line EOF? I checked no space anywhere from first line to last line - am I missing something?
0
 

Author Comment

by:mahjag
ID: 24091378
OK it is working now, I took all the extra spaces and made it as 1 line instead of separate lines..
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 125 total points
ID: 24091397
sorry I meant EOF. The code you posted in your question has leading space in the last line before EOF. There should not be any space
0

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

691 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