# SCCS_ID - "@(#)viewhost	1.3	86/07/01"
#
#   Copyright (c) 1986  The Wollongong Group, Inc.  All Rights Reserved
#
LIB=/usr/ethernet/ua
HOSTFILE=/etc/hosts
UAHOSTFILE=$LIB/HostTable
HOSTMENU=/tmp/Hosts$$.menu
trap "rm -f $HOSTMENU" 0
echo "Menu = Hostname/Internet address" > $HOSTMENU
echo "Label = Host Table" >> $HOSTMENU
echo "Prompt = Press ENTER to continue" >> $HOSTMENU
##
##fgrep "`sed 's/^Name=//' $UAHOSTFILE`" $HOSTFILE | awk '/^[0-9]/ { printf("Name=%-14.14s   %s    \n",$2,$1) }' >> $HOSTMENU
##
sed       -e 's/^Name[ 	]*=/\//'       -e 's/[ 	]*$/\/p/' $UAHOSTFILE > /tmp/win$$.sed
sed -n -f /tmp/win$$.sed $HOSTFILE | awk '/^[0-9]/ { printf("Name=%-14.14s   %s    \n",$2,$1) }' >> $HOSTMENU
rm -f /tmp/win$$.sed
RET=`shform -u $HOSTMENU`
if [ $? -ne 0 ]
then
	message "Shform returned error"
	exit;
fi
