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

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/'`
current_date=`date '+%d.%m.%Y'`
subject="\"SubVersion Status Report ($current_date)\""

if [ $svn_status != "" ]
  echo $svn_status | mail -c $cc -s $subject $to

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].



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links