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?
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)
Nice alternative