Admin/pmail
changeset 13321 70a5d5fc081a
parent 13320 2c6ee189ae63
child 14034 55ba81e3502b
equal deleted inserted replaced
13320:2c6ee189ae63 13321:70a5d5fc081a
    29 # argument checking
    29 # argument checking
    30 
    30 
    31 [ "$1" = "-?" ] && usage
    31 [ "$1" = "-?" ] && usage
    32 [ "$#" != "3" ] && usage
    32 [ "$#" != "3" ] && usage
    33 
    33 
    34 SUBJECT=$1
    34 SUBJECT="$1"
    35 TO=$2
    35 TO="$2"
    36 BODY=$3
    36 BODY="$3"
    37 
    37 
    38 [ -r $BODY ] || fail "could not read $BODY"
    38 [ -r "$BODY" ] || fail "could not read $BODY"
    39 
    39 
    40 case `uname` in
    40 case `uname` in
    41     Linux*)
    41     linux*|Linux*)
    42     mail -s "$SUBJECT" $TO <$BODY
    42     mail -s "$SUBJECT" "$TO" < "$BODY"
    43     ;;
    43     ;;
    44 
    44 
    45     SunOS*)
    45     SunOS*)
    46     mail -t $TO <<EOF
    46     mail -t "$TO" <<EOF
    47 Subject: $SUBJECT
    47 Subject: $SUBJECT
    48 
    48 
    49 `cat $BODY`
    49 `cat $BODY`
    50 EOF
    50 EOF
    51     ;;
    51     ;;