#!/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
<< [-]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.
#!/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