Solved

k shell syntax error..

Posted on 2009-04-07
10
520 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
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…
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.

840 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