[NTLUG:Discuss] How to suppress null message body report from mail

Neil Aggarwal neil at JAMMConsulting.com
Fri Jun 3 13:50:52 CDT 2005


Patrick:

That is way cool!

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 1:04 PM
> To: NTLUG Discussion List
> Subject: Re: [NTLUG:Discuss] How to suppress null message 
> body report from mail
> 
> 
> Oops, correction -- that should be:
> 
> egrep $PATTERN $LOG >/tmp/log-excerpt
> [ -s /tmp/log-excerpt ] && /bin/mail -s $SUBJECT $RECIPIENTS 
> </tmp/log-excerpt
> 
> Pm
> 
> 
> On Fri, Jun 03, 2005 at 01:01:23PM -0500, Patrick R. Michaud wrote:
> > On Fri, Jun 03, 2005 at 12:06:32PM -0500, Neil Aggarwal wrote:
> > > 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?
> > 
> > Oh sure, I almost sent that in my previous post but then decided 
> > that probably wasn't what you wanted.... :-)
> > 
> >     egrep $PATTERN $LOG >/tmp/log-excerpt
> >     [ -s /tmp/log-excerpt ] && /bin/mail -s $SUBJECT $RECIPIENTS 
> > 
> > Pm
> > 
> > 
> > > > -----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
> > > 
> > > 
> > > _______________________________________________
> > > https://ntlug.org/mailman/listinfo/discuss
> 
> _______________________________________________
> https://ntlug.org/mailman/listinfo/discuss
> 





More information about the Discuss mailing list