SEX! or, how do I mail to a lot of unix users?

Todd Merriman todd at stiatl.UUCP
Fri Jun 8 00:22:48 AEST 1990


if test "$1" -a "$2" -a "$3"
then
	if test -r $2
	then
		size=`wc -l $2`
		echo "$size recipients..."
		i=1
		while test $i -le $size
		do
			curmod=`sed -n ${i}p $2`
			echo "** mailing to $curmod $i/$size"
			i=`expr $i + 1`
	      case `uname -m` in
		      miti2)
	   		      mailx -s "$1" $curmod < $3
			      ;;
		      i386)	# rmail broken in Interactive
   			      mail $curmod < $3
			      ;;
	      esac
		done
	else
		echo "$2 missing!"
      exit 1
	fi
else
	echo 'mailist <subject> <destination list> <message file>'
   exit 1
fi
exit 0

.MODULE           mailist
.LIBRARY          util
.TYPE             command file
.SYSTEM           unix
.AUTHOR           Todd Merriman
.LANGUAGE         C
.APPLICATION      mail
.DESCRIPTION      
   Mail to a mailing list
.ARGUMENTS        
	mailist <subject> <destination list> <message file>
.NARRATIVE        
   The mailist utility calls the mail utility for each address in a mailing
   list.  This utility allows the user to maintain mailing lists of
   virtually unlimited size (which is not possible using aliases with
   mailx).  The mailing list is formatted such that each line contains
   one address.
.RETURNS          
   0 if successful, 1 if the mailing list cannt be found
.ENDOC            END DOCUMENTATION



More information about the Comp.unix.questions mailing list