#!/bin/sh
#
#set -x
#
##############################################################################
#                                                                            #
#  RCS Filename : gethn,v
#  RCS Date     : 1996/06/14 16:56:27
#  RCS Revision : 1.1
#  RCS Author   : lamberts
#  RCS State    : V2_0_B
#                                                                            #
#  Authors: Stefan Lamberts                                                  #
#                                                                            #
##############################################################################


USAGE="$0 <computefile> [<count>]"

######################################################################
# Extract the host name form a .compute file
######################################################################

if [ $# -eq 1 ]
then	if [ ! -r $1 ]
	then	echo "$0: Cannot read input file '$1'"; exit 1
	fi
	awk '{print $2}' $1 | sed -e 's/:.*//g'
elif [ $# -eq 2 ]
then	if [ ! -r $1 ]
	then	echo "$0: Cannot read input file '$1'"; exit 1
	fi
	awk '$1 < '$2'{print $2}' $1 | sed -e 's/:.*//g'
else	echo $USAGE
	exit 1
fi

exit 0
