#!/bin/ksh
# File: memo_to1 - Send a memo to one or more recipients.

if [ -z "$1" ]; then
  echo "Need a recipient."
  exit
fi

echo "Enter the memo. Press <Ctrl>D when finished:"
Memo="`cat`"

for recipient in $*
do
  mail $recipient << END_of_MEMO
MEMO
To:  $recipient (`grep "$recipient" /etc/passwd|cut -d: -f5`)
From:  $LOGNAME (`grep "$LOGNAME" /etc/passwd|cut -d: -f5`)
Date:  `date +'%A, %B %d'`

$Memo

Regards, `grep "$LOGNAME" /etc/passwd|cut -d: -f5`
END_of_MEMO
done

