Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] bash/mail: stop the send if body is blank

I have this script that runs daily:

cd /path/to/website/root
svn status | egrep -v '(path/to/' | mail -s "svn status
report" -c

It is a website and the idea is that if someone has been modifying files
directly this email will inform me so I can check-in their changes.

The problem is if there are no changes I get *two* emails, one is an
unwanted blank email, and the second is an even-more-unwanted email
telling me I just sent a blank email. How do I stop it sending blank emails?

I cannot see a mail option for it so I'm guessing this is a bash
question? I.e.
 svn status | BASH-MAGIC-HERE mail -s "..."

Thanks in advance,


Darren Cook, Software Researcher/Developer (About me and my work) (My blogs and articles)

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links