用ifconfig命令获取IP地址

yueqiming_1983
用ifconfig命令获取IP地址

想编写一个脚本,使其获得指定端口的IP地址,请各位赐教

dotnetdotcn
ifconfig eth1 | sed -n '/inet addr/p' | awk -F'[: ]+' '{print $4}'

无声无息
ifconfig eth0|awk -F"[: ]+" '/inet addr/{print $4}'