connecting ....sql

if[ $action = 'START' ];
sqlplus /nolog <<EOF
conn / as sysdba
spool /tmp/start.out
@/oracle/home/start.sql
spool off
exit
EOF
fi

For this code i am getting error:
Test.sh: syntax error at line 7 : `<<' unmatched

Could u try putting 'exit' after EOF ??

Also , try ';' after ORACLE statements whereever necessary .

Your if statement is illegal. You need

if [ $action = 'START' ]; then
.
.
.
.
fi

You forgot the "then", plus you had no whitespace between if and [

Cheers
ZB

PromptUser()
{
echo "Enter the owner of the Schema"
read User
if [ $action = 'export' ]; then
sqlplus /nolog <<EOF
conn / as sysdba
spool /tmp/start.out
@/oracle/home/user.sql
spool off
exit
EOF
fi
}

For this code i am getting error:
Test.sh: syntax error at line 7 : `<<' unmatched

I made all the changes as i got replies, but i am still getting the same error!

Is there any whitespace before the here document terminator (EOF in this case)?

e.g.

somecommand <<EOF
this
will
work
EOF

somecommand <<EOF
   but this
   will not
   EOF

Cheers
ZB

#UserTest.sh
User()
{
sqlplus /nolog <<EOF
conn / as sysdba
spool /tmp/check_User.out
start /oracle/home/check_FUser.sql;
spool off
exit
EOF
user=`cat /tmp/check_User.out`
echo $user
}

User

For this shell script i am getting the error
UserTest.sh: syntax error at line 7 : `<<' unmatched

try
function User () {etc etc }
the error could be that the shell doesn't recognize the script itself ending at line 7 because it doesn't know it is a function..
moxxx68

Check for white spaces before EOF on the same line ;
Try avoiding them.

   EOF 

#is wrong.

EOF

#is correct ;

also verify all below statements are syntax free.

conn / as sysdba
spool /tmp/check_User.out
start /oracle/home/check_FUser.sql;
spool off
exit

Dreams,

Please don't post duplicate threads. If somebody can help you, they will - starting new threads for the same problem is not going to get your problem solved any quicker.

If you'd like to post more information about an existing issue, please reply to the existing thread.

Thanks,
ZB