uuhosts

XMRJ4-B.BANERJEE bba at mtuxo.UUCP
Fri Feb 19 04:47:53 AEST 1988


This version of uuhosts blows up when trying to automatically extract
maps on our system (An Amdahl running Unix V.2).  The difference seems
to be with the versions of awk.  What follows is a patch to fix it (should
you have the same problem).

-- Binayak

*** OLDuuhosts.sh	Thu Feb 18 13:25:51 1988
--- uuhosts.sh	Fri Nov 13 19:37:34 1987
***************
*** 70,75
  		temphead=/tmp/maphead.$$
  		temptext=/tmp/maptext.$$
  		tempcomm=/tmp/mapcomm.$$
  		cp /dev/null $temphead
  		cp /dev/null $temptext
  		echo 'exec /bin/mail postmaster' > $tempcomm

--- 70,76 -----
  		temphead=/tmp/maphead.$$
  		temptext=/tmp/maptext.$$
  		tempcomm=/tmp/mapcomm.$$
+ 		tempmaph=/tmp/mapsh.$$
  		cp /dev/null $temphead
  		cp /dev/null $temptext
  		cp /dev/null $tempmaph
***************
*** 72,77
  		tempcomm=/tmp/mapcomm.$$
  		cp /dev/null $temphead
  		cp /dev/null $temptext
  		echo 'exec /bin/mail postmaster' > $tempcomm
  		echo 'Reply-To: postmaster' > $temphead
  		awk '

--- 73,79 -----
  		tempmaph=/tmp/mapsh.$$
  		cp /dev/null $temphead
  		cp /dev/null $temptext
+ 		cp /dev/null $tempmaph
  		echo 'exec /bin/mail postmaster' > $tempcomm
  		echo 'Reply-To: postmaster' > $temphead
  		awk '
***************
*** 77,82
  		awk '
  BEGIN	{
  	temphead = "'$temphead'"; tempcomm = "'$tempcomm'";
  	isuucpmap = 1;	# Assume most postings are map entries.
  	shead = 0; stext = 1; suucp = 2;
  	state = shead;

--- 79,85 -----
  		awk '
  BEGIN	{
  	temphead = "'$temphead'"; tempcomm = "'$tempcomm'";
+ 	tempmaph = "'$tempmaph'";
  	isuucpmap = 1;	# Assume most postings are map entries.
  	shead = 0; stext = 1; suucp = 2;
  	state = shead;
***************
*** 107,113
  }
  state == shead && /^$/	{
  	if (isuucpmap != 0) {
! 	print "PATH=/bin; umask 0002; cd '$UUCPMAP'" | "'$MAPSH'";
  		state = suucp;
  	} else
  		state = stext;

--- 110,116 -----
  }
  state == shead && /^$/	{
  	if (isuucpmap != 0) {
! 	print "PATH=/bin; umask 0002; cd '$UUCPMAP'" >> tempmaph ;
  		state = suucp;
  	} else
  		state = stext;
***************
*** 116,122
  		print $0 >> temphead;
  }
  state == suucp	{
! 	print | "'$MAPSH'";
  }
  state == stext	{
  	print;

--- 119,125 -----
  		print $0 >> temphead;
  }
  state == suucp	{
! 	print >> tempmaph ;
  }
  state == stext	{
  	print;
***************
*** 122,127
  	print;
  }
  ' > $temptext 2>&1
  		cat $temphead $temptext | sh $tempcomm
  		rm -f $temphead $temptext $tempcomm
  		exit 0

--- 125,131 -----
  	print;
  }
  ' > $temptext 2>&1
+ 		$MAPSH < $tempmaph >> $temptext 2>&1
  		cat $temphead $temptext | sh $tempcomm
  		rm -f $temphead $temptext $tempcomm $tempmaph
  		exit 0
***************
*** 123,129
  }
  ' > $temptext 2>&1
  		cat $temphead $temptext | sh $tempcomm
! 		rm -f $temphead $temptext $tempcomm
  		exit 0
  	;;
  

--- 127,133 -----
  ' > $temptext 2>&1
  		$MAPSH < $tempmaph >> $temptext 2>&1
  		cat $temphead $temptext | sh $tempcomm
! 		rm -f $temphead $temptext $tempcomm $tempmaph
  		exit 0
  	;;
  



More information about the Alt.sources mailing list