1
How can I add linebreaks between my egrep?
# nmap -sP 192.168.1.0/24 | egrep 'MAC|report'
I would like to add a linebreak after each of the two lines. What is the most efficient shorthand?
Essentially I'd like the result to be output like so:
Nmap scan report for 192.168.1.7
MAC Address: C4:42:02:xx:xx:xx (Samsung Electronics Co.)
Nmap scan report for 192.168.1.8
MAC Address: 04:F1:3E:xx:xx:xx (Apple)
Nmap scan report for 192.168.1.10
MAC Address: 70:18:8B:xx:xx:xx (Hon Hai Precision Ind. Co.)
This puts the space within each entry of the two lines where it should be connected instead of spaced – Benny – 2017-10-09T03:31:43.757
I don't understand what you are saying. I've updated my answe with the output I get. Can you update yours with the output you want ? – davidgo – 2017-10-09T03:35:34.423
I wonder if you are using a different OS and are running into a CR/LF difference - if thats all the problem is, you can pipe your output to "todos" or equivalent. – davidgo – 2017-10-09T03:41:01.143
Sorry for the confusion. I simply mean the linebreak should follow the 'MAC Address' line instead of the 'Nmap scan report' line – Benny – 2017-10-09T03:47:03.343