for i in {0..254};do ping -c 1 -W 0.1 XXX.YYY.ZZZ.${i} > /dev/null && arp XXX.YYY.ZZZ.${i}; done
のようにすればOK