#!/bin/bash #assume we call this program /bin/cruise_control error_file=/tmp/make.$$ cd /your/project/path make ${ARGS} 2> $error_file || { cat $error_file | /bin/mail -s "project build error" you@yout.com }