#!/bin/bash # Copyright (c) Michael Still 2001, released under the terms of the GNU GPL subnets="137.92.11 137.92.140 137.92.141 137.92.142 137.92.143" for subnet in $subnets do host=1 while [ $host -lt 255 ] do echo -n "$subnet.$host " if [ -f unclassified/$subnet.$host ] then echo -n "[cached] " else name=`/usr/bin/nslookup $subnet.$host | grep Name` if [ `echo $name | wc -c | tr -d " "` -gt 3 ] then echo $name > unclassified/$subnet.$host fi fi host=$(( $host + 1 )) done done