下面输出ABCD到MAIL_BODY里面去,CD都能输出了,为什么AB就是写不进去呢?
grep -sl "coloar" ${LOG_DIR}/IYECMA9D*.log > ${TMP_FILE} 2>> ${LOG_FILE}
grep -sl "olderr" ${LOG_DIR}/IYECMA9D*.log > ${TMP_FILE2} 2>> ${LOG_FILE}
##
MAIL_LST="/ryu1/common/rls/param/iyec_teijyo_check_mail.lst"
MAIL_FROM=`grep "MAIL_FROM" ${MAIL_LST} | awk -F"=" '{print $2}' | sed 's/"//g'`
MAIL_TO=`grep "MAIL_TO" ${MAIL_LST} | awk -F"=" '{print $2}' | sed 's/"//g'`
MAIL_TITLE=`grep "MAIL_TITLE" ${MAIL_LST} | awk -F"=" '{print $2}' | sed 's/"//g'`
#
if [ -s ${TMP_FILE} ] || [ -s ${TMP_FILE2} ]
then
echo "A" >> ${MAIL_BODY}
echo "B" >> ${MAIL_BODY}
if [ -s ${TMP_FILE} ]
then
echo "" > ${MAIL_BODY}
echo "C" >> ${MAIL_BODY}
cat ${TMP_FILE} >> ${MAIL_BODY} 2>> ${LOG_FILE}
fi
if [ -s ${TMP_FILE2} ]
then
echo "" >> ${MAIL_BODY}
echo "D" >> ${MAIL_BODY}
cat ${TMP_FILE2} >> ${MAIL_BODY} 2>> ${LOG_FILE}
fi
else
echo "E" >> ${MAIL_BODY}
fi