syntax error in audit script

Hi,

When I run the following script

#!/bin/sh
email="rc@dll.com"
subject="response times are more than a SECOND"
rt=`tail audit.log | grep -i operationResponseTime | awk '{print $2}'`
if [ $rt -le 10 ]
then
### Mail the file to the mailbox
mail -s $subject $email <<-end
$rt
~.
################################
else
echo " yahoo we are good"
fi

It gives me the following error

./checkResponse.sh: line 16: syntax error: unexpected end of fi

Please help me with this

Thanks

I don't see a termination for your '<<-end'.

no need for a '-' in the closing here-doc.

From 'man ksh':

     << [-]word
           The shell input is read up to a line that is the  same
           as word, or to an EOF. No parameter substitution, com-
           mand substitution, or file  name  generation  is  per-
           formed  on  word.  The  resulting  document,  called a
           here-document, becomes  the  standard  input.  If  any
           character  of  word  is  quoted,  no interpretation is
           placed upon the characters of the document. Otherwise,
           parameter  and command substitution occur, \NEWLINE is
           ignored, and \ must be used to quote the characters \,
           $,  `,  and  the  first  character  of  word.  If - is
           appended to <<, then all  leading  tabs  are  stripped
           from word and from the document.

specifically:

#!/bin/sh
email="rc@dll.com"
subject="response times are more than a SECOND"
rt=`tail audit.log | grep -i operationResponseTime | awk '{print $2}'`
if [ $rt -le 10 ]
then
### Mail the file to the mailbox
mail -s $subject $email << EOF
$rt
EOF
################################
else
echo " yahoo we are good"
fi