Script execution fails

hi,
i am trying to run this script, getting below error, can some one help me in this

Error: -bash: on_failure.sh: line 23: syntax error: unexpected end of file

========================================================
# CHANGE HISTORY
#
# YYYYMMDD Change by     Desription
# -------- ------------- -------------------------------------------------------
# 20130427        send email to example1@.com if user is asm_admin
#                        also add logging info
# ------------------------------------------------------------------------------
MAIL_TO=`echo $1 | sed s/\'//g`
FLOWCHART_NAME=`echo $2 | sed s/\'//g`
if [ "$MAIL_TO" = "asm_admin" ]; then
  MAIL_TO="admin@web.com"
fi
FROM_HOSTNAME=`hostname`
# log the flowchart process that calls this trigger
LOG_PREFIX="(`date`) [PPID:${PPID} PID:$$]"
FLOWCHART_PS=`ps -ef | grep " $PPID " | awk '{ if ( $2 == '$PPID' ) print }'`
YYYYMMDD=`date +"%Y%m%d"`
OUTPUT_LOG=/u01/partitions/scripts/EmailNotificationTriggers/logs/on_failure_${YYYYMMDD}.log
echo "$LOG_PREFIX  The parent flowchart process: \"$FLOWCHART_PS\"" >>$OUTPUT_LOG 2>&1
echo "$LOG_PREFIX  Notify ${MAIL_TO} of flowchart failure: ${FLOWCHART_NAME}"  >>$OUTPUT_LOG 2>&1
echo "Login to system to verify cause of the failure. \n\n${FLOWCHART_PS}" | 
 mailx -r "system_${FROM_HOSTNAME}_NoReply@web.com" -s "Flowchart run failed: $FLOWCHART_NAME" $MAIL_TO   >> $OUTPUT_LOG 2>&1

Thanks
SZS

Try it with a line continuation:

echo "Login to system to verify cause of the failure. \n\n${FLOWCHART_PS}" | /
mailx -r "system_${FROM_HOSTNAME}_NoReply@web.com" -s "Flowchart run failed: $FLOWCHART_NAME" $MAIL_TO   >> $OUTPUT_LOG 2>&1

Or put the last 2 lines on 1 line:

echo "Login to system to verify cause of the failure. \n\n${FLOWCHART_PS}" | mailx -r "system_${FROM_HOSTNAME}_NoReply@web.com" -s "Flowchart run failed: $FLOWCHART_NAME" $MAIL_TO >> $OUTPUT_LOG 2>&1

Is anything being written into the log file before you get the diagnostic from bash?

Exactly what are the operands to this script when it fails?

Does it always fail, or does it only fail when it is invoked with certain operands?

What OS are you using?

Not to disagree with spacebar, but bash shouldn't behave differently if the script is left as is, if a backslash is added to the end of the next to the last line, or if the last two lines are joined into a single line.