Yes, this is 1.4.1 on a Pi.
However, I had a closer look at the output of the nems-info script.
returns:
so, this is an IPV6 address...
returns:
The grep that this is piped to probably gets confused...
EDIT: I experimented somewhat with the grep command and this does the trick:
However, I had a closer look at the output of the nems-info script.
Code:
host_ip=$(getent ahosts "$host" | awk '{print $1; exit}')
returns:
Code:
2a00:1450:400e:806::200e
so, this is an IPV6 address...
Code:
interface=`ip route get "$host_ip"`
returns:
Code:
2a00:1450:400e:806::200e from :: via fe80::de53:7cff:feec:d56b dev eth0 proto ra src 2a02:1812:1709:ac00:ba27:ebff:fe42:c170 metric 1024 hoplimit 64 pref high
The grep that this is piped to probably gets confused...
EDIT: I experimented somewhat with the grep command and this does the trick:
Code:
| grep -Po '(?<=dev )[^ ]+'
Code:
echo "2a00:1450:400e:806::200e from :: via fe80::de53:7cff:feec:d56b dev eth0 proto ra src 2a02:1812:1709:ac00:ba27:ebff:fe42:c170 metric 1024 hoplimit 64 pref high" | grep -Po '(?<=dev )[^ ]+'
eth0