Hello all,
I have the following data
I'm trying to do a couple of things
1. Delete all records which contain No NS Record
2. Join the line containing Name: with the previous IP
To get the following output
What I've tried so far
awk '/^-/,/No NS Record/'
&
awk '/^-/{f=1}/No NS Record/{f=0}f'
&
BEGIN {
RS=FS=""
}
$1 ~ /^- +/ && $2 ~ /^Name +/ {print prev}
{prev=$NF}
Ran the above code thru nawk --- No Output...
Mike
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
I have the following data
Code:
--------------------------------------
10.0.193.1
Name: servername.company.com
--------------------------------------
10.0.193.2
No NS Record
--------------------------------------
10.0.193.3
No NS Record
--------------------------------------
I'm trying to do a couple of things
1. Delete all records which contain No NS Record
2. Join the line containing Name: with the previous IP
To get the following output
Code:
10.0.193.1 server.ourcompany.com
10.0.193.27 server2.ourcompany.com
What I've tried so far
awk '/^-/,/No NS Record/'
&
awk '/^-/{f=1}/No NS Record/{f=0}f'
&
BEGIN {
RS=FS=""
}
$1 ~ /^- +/ && $2 ~ /^Name +/ {print prev}
{prev=$NF}
Ran the above code thru nawk --- No Output...
Mike
"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."