mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 01:01:27 +00:00
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7271 d57e44dd-8a1f-0410-8b47-8ef2f437770f
33 lines
675 B
Bash
Executable File
33 lines
675 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# Don't forget to set the variables 'from' and 'realname' in ~/.muttrc !!
|
|
|
|
usage() {
|
|
echo "Usage: $0 [-r <recipient>] <subject> <file-to-mail> [<file-to-attach>]"
|
|
}
|
|
|
|
recipients="scst-devel@lists.sourceforge.net"
|
|
recipients="bvanassche@acm.org"
|
|
|
|
while [ "$1" != "${1#-}" ]
|
|
do
|
|
case "$1" in
|
|
'-r') recipients="$2"; shift; shift;;
|
|
'-h') usage; exit 1;;
|
|
'--') shift;;
|
|
*) usage; exit 1;;
|
|
esac
|
|
done
|
|
|
|
if type mutt >/dev/null 2>&1; then
|
|
if [ $# -ge 3 ]; then
|
|
gzip -9 <"$3" >"$3.gz"
|
|
mutt -s "$1" -a "$3.gz" ${recipients} < "$2"
|
|
rm -f "$3.gz"
|
|
else
|
|
mutt -s "$1" ${recipients} < "$2"
|
|
fi
|
|
else
|
|
mail -s "$1" ${recipients} < "$2"
|
|
fi
|