Here's the diff. OK, it's lame but should work:
Code:
--- scriptname 2006-06-20 00:00:00.000000000 -0800
+++ scriptname 2006-06-20 00:00:01.000000000 -0800
@@ -45,6 +45,7 @@
else
echo "***** WARNING TAPE DRIVE IS OFFLINE, NO BACKUPS PERFORMED"
fi
+letsEmailThis() {
FINISH=`date +%s`
diff=$((FINISH - START))
echo -n "***** Total Run Time: "
@@ -70,4 +71,7 @@
else
echo "$SEC secs."
fi
-fi
+fi; }
+letsEmailThis 2>&1 | mail -s "You want it, you got it, the biggest band in the land..." root
+
+exit 0
OK. So I'm lazy cuz basically you wrap in a function, call it and email the output.
Apply as "cat diff | patch --dry-run <insert scriptname here>". YMMV(VM).