Solved

k shell syntax error..

Posted on 2009-04-07
10
519 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
  • 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 

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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

810 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