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: Thu, 13 Jan 2011 18:03:07 +0900
- From: Darren Cook <darren@example.com>
- Subject: Re: [tlug] bash/mail: stop the send if body is blank
- References: <mailman.1.1294801202.11388.tlug@example.com> <20110112124503.GC20421@example.com>
- User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7
> This is not the shortest solution, but in Bash scripts you rather > want readability/maintainability instead of cleverness anyway. Thanks Bjoern. Good point, and as it was already a script (rather than a one-liner) I've broken it up a bit as you suggest. I just made one fix, as noted below. Without the double quotes it treated the svn output as multiple parameters, not a single string. > 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. Not in this case; the point of this script is to tell me when users who are not svn-aware have changed the web site. (I already use post-commit to tell me what the svn users are changing :-) Darren > 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 != "" ] if [ "$svn_status" != "" ] or: if [ -n "$svn_status" ] > then > echo $svn_status | mail -c $cc -s $subject $to > fi -- Darren Cook, Software Researcher/Developer http://dcook.org/work/ (About me and my work) http://dcook.org/blogs.html (My blogs and articles)
- Follow-Ups:
- Re: [tlug] bash/mail: stop the send if body is blank
- From: Darren Cook
- References:
- Re: [tlug] bash/mail: stop the send if body is blank
- From: Bjoern Rennhak
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] ibus-anthy in RHEL6
- Next by Date: [tlug] [TotD] Detecting CJK characters in a string in Ruby
- 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