[NTLUG:Discuss] How to suppress null message body report from mail
Patrick R. Michaud
pmichaud at pobox.com
Fri Jun 3 08:13:28 CDT 2005
Neil Aggarwal wrote:
>Null message body; hope that's ok
>
>Is there a way to suppress generating this message from
>mail? I have read the man page but I don't see anything
>that will help.
Actually, rather than trying to prevent mail from generating the
message, can you just redirect it to an appropriate black hole?
Try changing your command line to
cat $LOG | egrep $PATTERN | /bin/mail -s $SUBJECT $RECIPIENTS >/dev/null
Even better (the "cat" seems superfluous):
egrep $PATTERN $LOG | /bin/mail -s $SUBJECT $RECIPIENTS >/dev/null
With this, cron won't ever get any output from the mail command so
it won't send a cron report.
Pm
More information about the Discuss
mailing list