how to find the device name as ( e1000g2 , e1000g3 , etc ) according to his IP address on Solaris machine
for example
ifconfig -a | grep 10.106.134.133
inet 10.106.134.133 netmask ffffff00 broadcast 10.106.134.255
ifconfig with grep command view only the line with the IP address , and the device name appears before the IP address
so my target is to match the device name according to the IP address on Solaris machine , and then insert the device name in to parameter ( ksh )
please advice?
full example: from ifconfig -a ( I get the IP and device name , what I need is to find the device name according to IP address , and insert the device name in to parameter )
e1000g2: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 inet 10.106.134.133 netmask ffffff00 broadcast 10.106.134.255