I'm trying to format arp -a output to my liking. For example at the moment it outputs:
MyRouter (172.16.3.x) at XX:XX:XX:XX:XX:XX [ether] on eth0
PC1 (172.16.3.x) at XX:XX:XX:XX:XX:XX [ether] on eth0
PC2 (172.16.3.x) at XX:XX:XX:XX:XX:XX [ether] on eth0
But I want it to output something like:
MyRouter;172.16.3.x;XX:XX:XX:XX:XX:XX
PC1;172.16.3.x:XX:XX:XX:XX:XX:XX
PC2;172.16.3.x;XX:XX:XX:XX:XX:XX
If I echo one of the lines with a BAD sed command that I created, it'll format the output to my liking but I can't use it on an arp -a command
Command:
$ echo "MyRouter (172.16.3.x) at XX:XX:XX:XX:XX:XX [ether] on eth0" | sed 's/ (/;/g' | sed 's/) at /;/g' | sed 's/ \[.*//g'
MyRouter;172.16.3.x;XX:XX:XX:XX:XX:XX
But how can I format the arp -a output like this?