Hi,
I am trying to format my out put from the results of an nmap command. I would like to basically generate a simple two column list with ip addresses and mac address. I have managed to strip out most of what I don't want with combinations of awk, grep and sed. my problem is not all the rows are the same, some contain host names and other don't. This makes it hard for me to use cut to remove the "Unknown" in the last column. I am struggling with a regex to use in a sed to remove the hostnames from rows that contain it. thoughts? here is some sample output:
Dev.us.corp.com 9.148.53.232 6A:8D:93:5E:1C:6E Unknown
QA2-Zpro.us.corp.com 9.148.53.235 00:14:5E:46:E7:B7 corp
Dev.us.corp.com 9.148.53.240 72:B5:01:E3:FE
7 Unknown
files.us.corp.com 9.148.53.246 00:14:5E:1E:1F:80 corp
Dev.us.corp.com 9.148.53.247 22
B:5C:22:AE:3C Unknown
source.us.corp.com 9.148.53.248 00:21:5E:F0:A3:39 corp
Dev.us.corp.com 9.148.53.249 22:F2:31:65:65:E4 Unknown
9.148.55.4 C8:4C:75:68:E3:42 Unknown
9.148.55.5
9.148.55.10 46:36:B9:18:8E:CB Unknown
9.148.55.15 96:7B:62:06:E0:B6 Unknown
9.148.55.16 00:16:41:37:43:AD USI
9.148.55.17 00:21:86:14:6C:4E USI
9.148.55.25 E4:1F:13:1F:16:CE Unknown