Build precise queries to find exactly what you need
Press ESC to close
@divad27182
Favorites0
Views
Projects0
1) for me, at least, the arp command is /usr/sbin/arp 2) it might be better to just replace everything from the gta= line to the ttl= line with something like: ttl=$( /usr/sbin/arp -n | grep ether | awk '{ print $3 }' | sort | uniq -d | wc -l ) This is 10 times faster (on my relatively small net), but only counts 1 for each mac that appears two or more times. If you want a MAC appearing three times to give a count of two, try: gta=`/usr/sbin/arp -n | grep ether | awk '{ print $3 }'` gtl=`echo "$gta" | sort -u | wc -l` tot=`echo "$gta" | wc -l` ttl=$(( $tot - $gtl ))
Reviewed 7 years ago