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..
I have the following code in k shell that errors..
#!/bin/ksh
sqlplus -s /nolog <<EOF > $MYFOLDER/logs/spool_file.
set serveroutput on
start $HOME/connect_oracle
execute mypack.procedure($SOURCE,$
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..
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..
I tried sqlplus -s /nolog <<-EOF > $MYFOLDER/logs/spool_file.
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?
how you edit the script file? are you transferring it from windows?
ASKER
using vi editor in unix
is it working now?
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
#!/bin/ksh
sqlplus -s /nolog <<EOF > $MYFOLDER/logs/spool_file.
set serveroutput on
start $HOME/connect_oracle
execute mypack.procedure($SOURCE,$
exit
EOF
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sqlplus -s /nolog <<-EOF > $MYFOLDER/logs/spool_file.