[NTLUG:Discuss] How to suppress null message body report from mail
Neil Aggarwal
neil at JAMMConsulting.com
Fri Jun 3 12:06:32 CDT 2005
Patrick:
This leads me to another question:
Is there a way to change my script to not send an email if there
is no content?
Thanks,
Neil
--
Neil Aggarwal, JAMM Consulting, (214) 986-3533, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by
17% or more in 6 months or less! http://newsletter.JAMMConsulting.com
> -----Original Message-----
> From: discuss-bounces at ntlug.org
> [mailto:discuss-bounces at ntlug.org] On Behalf Of Patrick R. Michaud
> Sent: Friday, June 03, 2005 8:13 AM
> To: NTLUG Discussion List
> Subject: Re: [NTLUG:Discuss] How to suppress null message
> body report from mail
>
>
> 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