title: Get live hosts MAC in local network
body: <p>Hi I'm working on a small bash script that will scan lan every 5 minutes and get live host and then get theirs MAC addresses.</p>
  
  <p>So far I have this:</p>
  
  <pre><code>nmap -sP -n -oG - 10.0.0.1-20 | grep "Up" | awk '{print $2}'
  </code></pre>
  
  <p>Which gives me ip addresses. Now I have to do something like</p>
  
  <pre><code>arp -an | grep 'ip'
  </code></pre>
  
  <p>but I'm new to bash and I don't know how :)</p>