[root@localhost ~]# echo "This is IP = $(ifconfig | grep -o 'inet addr:[^[:space:]]*' | cut -d: -f2 | grep -v '127.0.0.1')"
显示结果为:This is IP = x.x.x.x
[root@localhost ~]# echo "This is IP = $(ifconfig | grep -o 'inet addr:[^[:space:]]*' | cut -d: -f2 | grep -v '127.0.0.1')"
显示结果为:This is IP = x.x.x.x