I need a script to take input in the form of a server name, perform the nslookup command, output only the actual IP server address (not the DNS server) and print the output. I have part of the script but need help on the rest. Thanks.
echo “Enter a ServerName.\n”
nsLook = $(echo nslookup $serverName | egrep -o “Non*" | # this is the part where I need help with getting the last IP address
echo “Do you have another?\n”
next;; # this is the part where I need help