Hi.
#!/bin/bash
look=$( for i in $(cat list ); do nslookup $i | grep Address | grep -v -e "53" -e "Server" | cut -d ':' -f2; done; )
var1="1.1.1.1"
for abc in $look
do
if
$abc = $var1 ; then
echo ""
echo "$abc - Ip is correct - "
echo ""
else
echo ""
echo "$abc - IP is not correct - "
echo ""
fi
done
I want the output like following.
1.1.1.1 - IP is correct example.com
Currect script only print output
1.1.1.1 - IP is correct -
Can any one help me to add domainname with the output.
Regards