#!/bin/bash source /etc/mail.conf "git-status" || exit 1 CONFIGSTATUS="$(cd / && git status | egrep -ve "^(On branch|Your branch|No commits|nothing|$)" -e "\(use")" [[ -z "$CONFIGSTATUS" ]] && exit 0 mailx "${MAILX_ARGS[@]}" -S from="$EMAIL_FROM" -s "git statuses" "${EMAIL_TO[@]}" <<<"$CONFIGSTATUS"