Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I would like to process the output of nslookup 1

Status
Not open for further replies.

jdespres

MIS
Aug 4, 1999
230
US
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
 
nslookup $i | awk '/Name:/{printf "%s\t",$2;getline;print $2}'


Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top