#! /bin/csh -f if ( $#argv != 2 ) then echo 'usage: '"$0"'
' echo ' or: '"$0"'
' exit 1 endif set fn = "$1" set addr = "$2" # The following is to prevent "mail" from munging tildes: setenv escape '' if ( ! ( -r "$fn" ) ) then echo 'file '"$fn"' is not readable exit 1 endif if ( -d "$fn" ) then echo "sending ${fn}/*..." set cfn = "${fn}.tar.Z" /bin/tar cvf - "${fn}" | /usr/ucb/compress -f | /bin/uuencode "${cfn}" \ | /usr/ucb/mail -s "${fn}" "${addr}" "${USER}" else if ( -f "$fn" ) then echo "sending ${fn}..." /bin/ls -l ${fn} set cfn = "${fn}.Z" /bin/cat "${fn}" | /usr/ucb/compress -f | /bin/uuencode "${cfn}" \ | /usr/ucb/mail -s "${fn}" "${addr}" "${USER}" else echo "$fn"' is not a plain file or directory.' exit 1 endif