Awk
Pick out the fourth token:
mac=`/sbin/arp -a $ip | awk '{print $4}'`
Separate by = instead of whitespace:
echo "a=b=c" | awk -F= '{print $3}' # selects "c"
Pick out the fourth token:
mac=`/sbin/arp -a $ip | awk '{print $4}'`
Separate by = instead of whitespace:
echo "a=b=c" | awk -F= '{print $3}' # selects "c"