Shell script using arp fails

Im writing a script that should copy the output of arp into a variable.

#!/bin/sh
MSG=$(arp)

However i get : arp : not found

when i use arp in a terminal arp works fine

anyone?

For anyone interested the next line fixed my problem

MSG=$(cat /proc/net/arp)

You could also do:

MSG=$(ip neigh)
1 Like

Nice alternative :slight_smile: