#! /bin/csh
# 
# This file takes a tools-hosts file (host names and resource limits), and
# a file of host names, and subsets tools-hosts to stdout.
# There are 11 fields
# Here is the approach.  We take the two files and combine them, then sort them
# Because of the sort rules, the hostnames will preceed the lines from 
# the database
cat $1 $2 | sort | \
awk '{ if ($1 == "#") next ; else { if ($11 == "") v = $1 ; else if ($1 == v) print $0 ; } }' 
