Unix:mail sending issue..pls help me soon
Hi people
Can u help me aorund on this
cat $DISTRIBUTION_LIST | tail -1 | read mailtolist
test -s $INOVOICES.dat
if [ $? -gt 0 ]
then
echo " Sales Report generted" | read subject
mailx -ms "${subject}." $mailtolist
RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
echo "Messaging Failed." >> $LOG_FILE
exit 1
fi
else
echo "NO Report" | read subject
mailx -ms "${subject}." $mailtolist
RET_CODE=$?
if [ $RET_CODE -ne 0 ]; then
echo "Messaging Failed." >> $LOG_FILE
exit 1
fi
fi
echo 'END DATE : ' `date` >> $LOG_FILE
exit $RET_CODE
If the file is greater than Zero byte it shuld send a mail with a subject Sales Report generted ,if the file is zero byte,it shuld send a message like No reports.
i created the above code...it's not working ...anybody can help me to modify the script....it's little bit urgent....
|