Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] bash/mail: stop the send if body is blank
- Date: Wed, 12 Jan 2011 21:45:03 +0900
- From: Bjoern Rennhak <bjoern@example.com>
- Subject: Re: [tlug] bash/mail: stop the send if body is blank
- References: <mailman.1.1294801202.11388.tlug@example.com>
- User-agent: Mutt/1.5.21 (2010-09-15)
Hello Darren, since you depend on the output of svn status why don't you try something like this (untested, my bash is a bit rusty anyway). svn_status=`svn status | egrep -iv 'path/to/ignore.me.file'` current_date=`date '+%d.%m.%Y'` subject="\"SubVersion Status Report ($current_date)\"" to="blah@example.com" cc="someone@example.com someone2@example.com" if [ $svn_status != "" ] then echo $svn_status | mail -c $cc -s $subject $to fi This is not the shortest solution, but in Bash scripts you rather want readability/maintainablitiy instead of cleverness anyway. In general though, I wonder if you rather don't want svn a post-commit hook solution which dumps to a regular log file. Then from that you could diff and send easily by mail via cron. Btw. I think you are probably interested in reading this [1]. Cheers, Bjoern [1] http://tldp.org/LDP/abs/html/
- Follow-Ups:
- Re: [tlug] bash/mail: stop the send if body is blank
- From: Darren Cook
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] ibus-anthy in RHEL6
- Next by Date: Re: [tlug] ibus-anthy in RHEL6
- Previous by thread: Re: [tlug] bash/mail: stop the send if body is blank
- Next by thread: Re: [tlug] bash/mail: stop the send if body is blank
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links