I wrote the following code to send a mail and return a status of 1.
Code:
EMAIL_MSG=`cat message.txt`
mailx -s "${THIS_SCRIPT} $finished." $EMAIL_USERS <<EOF
Shell script : ${THIS_SCRIPT}
${EMAIL_MSG}
EOF
exit 1
Everything works fine except that the message body of the mail also contains
EOF
exit 1