I would like to process the output of nslookup...
Here's what comes up ::-->
nslookup Server
Server: DNS_server
Address: xx.xx.xx.xx
Name: Server_Name
Address: yy.yy.yy.yy
I would like to generate the following output to look like this ::--->
Server Server_Name yy.yy.yy.yy
I've created the following function ::--->
NSlookup () {
for i in `[ -f $* ] && cat $* || echo $*`
do
echo "************** $i **************"
nslookup $i | awk '/Name:/ {print $2;echo "\c";getline;print $2}'
done
}
I'm stuck on putting data on one line....
Thanks...
Joe Despres
Here's what comes up ::-->
nslookup Server
Server: DNS_server
Address: xx.xx.xx.xx
Name: Server_Name
Address: yy.yy.yy.yy
I would like to generate the following output to look like this ::--->
Server Server_Name yy.yy.yy.yy
I've created the following function ::--->
NSlookup () {
for i in `[ -f $* ] && cat $* || echo $*`
do
echo "************** $i **************"
nslookup $i | awk '/Name:/ {print $2;echo "\c";getline;print $2}'
done
}
I'm stuck on putting data on one line....
Thanks...
Joe Despres