#! /bin/ksh HOME=~dde umask 022 mkdir /tmp/dde$$ cd /tmp/dde$$ trap 'cd; rm -rf /tmp/dde$$' 0 1 2 3 15 #trap 'rm -rf *$$.*' 0 1 2 3 15 # i=`ls -1 $i/* | egrep -v TARFILE.Z$` /usr/local/bin/csplit -f m$$. - '/^$/+1' > /dev/null subject=`egrep -i ^Subject: m$$.00` from=`egrep -i ^Reply-To: m$$.00` from=${from#?????????} if test ! "$from"; then from=`egrep -i ^From: m$$.00` from=${from#?????} fi typeset -l request file request=${subject##* } for i in ~/* nosuch; do file=${i##*/} test "$file" = "$request" && break; done if test "$file" = nosuch; then echo Error: could not process request | mailx -s "Error message" "$from" exit 1 fi if test -d "$i"; then cp -r "$i" . i=${i##*/} rm -f "$i"/TARFILE.Z uncompress "$i"/*Z 2> /dev/null fi /usr/local/bin/shar -c -L64 -o $request$$ "$i" 2> /dev/null for i in $request$$*; do mailx -s "$request part${i##*.}" "$from" < $i done echo "Sent $request to $from" | mailx -s "dde mail" ddel@thor.ece.uc.edu