I've created the function to display interfaces and IP's per interface
network() {
iplst() {
ip a show "$i" | grep -oP "inet\s+\K[\w./]+" | grep -v 127
}
ip ntable | grep -oP "dev\s+\K[\w./]+"| grep -v lo | sort -u >> inf_list
netlist="inf_list"
while read -r i
do
infd=$i
paste <(echo -e $i) <(iplst)
done < $netlist
}
Current output:
ens32 10.0.0.2/24
10.0.0.4/24
10.0.0.20/24
ens33 192.168.1.3/24
ens34 192.168.0.2/24
ens35 192.168.2.149/24
but would like to avoid creation of temp files, would appreciate suggestions