if test $# -lt 3; then
  echo "Usage: tarmail [-k] mailpath \"subject-string\" directory-or-file(s)"
  exit
else
  if test $1 = -k; then
    key=on
    shift
  else
    key=
  fi
  mailpath=$1
  echo "mailpath = $mailpath"
  shift
  subject="$1"
  echo "subject-string = $subject"
  shift
  echo files = $*
  if test -n "$key"; then
    echo -n 'keyword? '
    key=`head -1 /dev/tty`
  fi
  tar cvf - $* | compress | btoa "$key" | mail -s "$subject" $mailpath
fi
