How to place the output of an echo statement and an arp statement on one line? How to place the output of an echo statement and an arp statement on one line? shell shell

How to place the output of an echo statement and an arp statement on one line?


this should do output in single line

ipRange="192.168.0."macaddress=$(arp  | grep -w  "$ipRange$1" | awk '{print $3,$1}')ping -c1 "$ipRange$1" > /dev/null         if [ $? -eq 0 ]; thenecho  "deze host met mac address en ip address is up $macaddress"else echo "het is down"fi


Just replace macaddress= arp | grep -w "$ipRange$1" | awk '{print $3,$1}'

with macaddress=$(arp | grep -w "$ipRange$1" | awk '{print $3,$1}')