[net.mail] usmail shell script

dan@netword.UUCP (12/07/83)

>From spotter Wed Nov 30 19:13:38 1983
To: netword!dans
Subject: usmail "script"

I thought that you might want to have/distribute this script - it
should be fairly obvious what it does. If you have any questions
just mail or give me a call.

				Steve Potter
				(503) 627-4084

CSnet:	  spotter@tek
ARPAnet:  spotter.tek@rand-relay
uucp:	  {ucbvax,decvax,chico,pur-ee,cbosg,ihnss}!teklabs!tekcad!spotter

============= /usr/public/usmail =============
#! /bin/csh -f
set CHMOD	= /bin/chmod
set CP		= /bin/cp
set MAILER	= /usr/ucb/mail
set RM		= /bin/rm
set VI		= /usr/ucb/vi
set FILE	= /tmp/usmail$$

if (-r ~/.usmform) then
	$CP ~/.usmform $FILE
else
	$CP /usr/public/lib/.usmform $FILE
endif
$CHMOD 600 $FILE

if ($?EDITOR == 0) set EDITOR = $VI

# If user's editor is vi, we can set the wrap-margin.
# Otherwise, user will have to watch the margins him/herself.

set ed = $EDITOR
set ed = $ed:t
if ($ed != vi) then
	$EDITOR $FILE
else
	$EDITOR "+:set wm=15 | 2" $FILE
endif
unset ed

echo ""
echo -n "Ok to mail [yn]? "
set reply = $<
if (($reply != 'n') && ($reply != 'N')) then

# probably should post-process out lines > 65 for non-vi users

	$MAILER netword\!ecom $USER < $FILE
else
	echo ""
	echo -n "Save it [yn]? "
	set reply = $<
	if (($reply != 'n') && ($reply != 'N')) then
		echo ""
		echo -n "What file? "
		set save_file = $<
		$CP $FILE $save_file
	endif
endif
$RM $FILE
============= /usr/public/lib/.usmform =============

rlgvax!allegra!tektronix!tekcad!USERNAME
FROM NAME(30)
FROM ORGANIZATION(30)
FROM STREET(30)
FROM CITY,STATE(20)
FROM ZIP(10)
TO NAME(30)
TO ORGANIZATION(30)
TO STREET(30)
TO CITY,STATE(20)
TO ZIP(10)



TEXT(65)
============= end =============