Skip to content

Instantly share code, notes, and snippets.

@chrispetrou
Created September 4, 2019 23:32
#!/bin/bash
if [ $# -lt 1 ]; then
echo "getmac.sh <IP>"
fi
IP=$1
ping_output=$(ping -c1 $IP)
mac=ping_output; arp -a | grep $IP | cut -d ' ' -f4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment