#! /bin/ksh

# Send HCI Education Survey Files via email

#cd /n/archive/1/ftp/pub/hci/Education
# cd /usr2/users/perlman/educhi/Survey
cd /acminfo/2/sigs/sigchi/educhi

if test $# -eq 0
then
	echo Usage: $0 recipient [file...]
	exit 2
fi

recipient=$1; shift

if test $# -eq 0
then
	set -- README *.rpt Data/*.*
fi

for i
do
	echo "$0: sending $recipient $i"
	Mail -s "HCI Education Survey: $i" $recipient < $i
	if test $# -gt 0
	then
		sleeptime=1 #`/usr/ucb/uptime | /usr/bin/tr , 0 | dm "floor(${SLEEP-10}*x[N-2])"`
		if test $sleeptime -gt 0
		then
			echo "$0: sleeping $sleeptime"
			sleep $sleeptime
		fi
	fi
done

