Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 538
  • Last Modified:

k shell syntax error..

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
mahjag
Asked:
mahjag
  • 5
  • 5
1 Solution
 
omarfaridCommented:
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
 
mahjagAuthor Commented:
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
 
omarfaridCommented:
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
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.

 
mahjagAuthor Commented:
using vi editor in unix
0
 
omarfaridCommented:
is it working now?
0
 
mahjagAuthor Commented:
and I checked there is no space after the last line
0
 
omarfaridCommented:
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
 
mahjagAuthor Commented:
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
 
mahjagAuthor Commented:
OK it is working now, I took all the extra spaces and made it as 1 line instead of separate lines..
0
 
omarfaridCommented:
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

Industry Leaders: 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!

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now