1  使用命令提取本机IP地址方法:

ifconfig eth0 |grep Mask | awk '{print $2}'|cut -d : -f 2  -f 第几个域


2 awk

 awk '{print $1,$NF}' 3.txt