Path: utzoo!hoptoad!ptsfa!ihnp4!homxb!mtuxo!bba From: bba@mtuxo.UUCP (XMRJ4-B.BANERJEE) Newsgroups: alt.sources Subject: Re: uuhosts Keywords: automatic uucp map extraction Message-ID: <1337@mtuxo.UUCP> Date: 18 Feb 88 18:47:53 GMT References: <8172@eddie.MIT.EDU> Reply-To: bba@mtuxo.UUCP (XMRJ4-B.BANERJEE) Distribution: na Organization: AT&T IS, Middletown NJ Lines: 131 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 ;;