The third element of the match() function is a GNU awk extension. How about this:
#!/bin/bash
awk '
BEGIN {RS="\++ NMInterface";OFS=FS="\n";ORS="\n\n"}
{print $4,$9,substr($0, match($0, /IfName:/), 18)}
' your.file
The third element of the match() function is a GNU awk extension. How about this:
#!/bin/bash
awk '
BEGIN {RS="\++ NMInterface";OFS=FS="\n";ORS="\n\n"}
{print $4,$9,substr($0, match($0, /IfName:/), 18)}
' your.file
Ripat,
I'm disturbing you so much. Here is the result.
# ./int
Memory fault(coredump)
Thanks,
Gobinathan.S
Well, I am sorry ntgobinath but I only have GNU Linux boxes to test your problem. May be someone with an HP-UX machine will jump in. But no doubt awk is the way to go, especially if you have a large file to process.