Link to home
Start Free TrialLog in
Avatar of mahjag
mahjag

asked on

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..
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

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


Avatar of mahjag
mahjag

ASKER

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..
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?
Avatar of mahjag

ASKER

using vi editor in unix
is it working now?
Avatar of mahjag

ASKER

and I checked there is no space after the last line
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
Avatar of mahjag

ASKER

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?
Avatar of mahjag

ASKER

OK it is working now, I took all the extra spaces and made it as 1 line instead of separate lines..
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial