$ for prefix in $(for i in $(nmap -sn foo_network/24|rg for); do ping $i -c 1 -w 1 2> /dev/null ; arp $i 2>/dev/null ; done|rg ether.* -o 2>/dev/null |cut -d ':' -f 1-3|awk '{ print $2 }'|sed 's/://g'); do grep $prefix /usr/share/nmap/nmap-mac-prefixes -i ; done