#!/bin/csh -f # nslookup_loop # ----------------------------------------------------------------------------- # C shell script to loop, showing the IP address of a hostname or domain name # ----------------------------------------------------------------------------- # Usage: See Usage section below or run with -h or --help to see usage. # Assumptions: # Effects: # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ----------------------------------------------------------------------------- # Collect command line options while ($#argv > 0) if ("$1:q" == "-h" || "$1:q" == "--help") then echo "Usage: $0:t host_or_domain_name" exit 1 else if ("$1" != "-" && "-" == "`echo $1:q | cut -c 1`") then echo "Error: Invalid option: $1:q" $0 --help exit 1 else # Not a recognized option. Assume it's the first parameter break endif end # Collect command line arguments if ($#argv > 1) then echo "Error: Too many arguments" $0:t --help exit 1 else if ($#argv < 1) then echo "Error: Must specify a host or domain name" $0:t --help exit 1 endif while ( 1 == 1 ) echo -n "`date` " nslookup_bare_ip_address $1:q sleep 1 end