shell 脚本获取本地ip地址方法

最近在用shell脚本进行code  记一下

localip=$(ifconfig | grep 'inet'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $2}' )

posted @ 2016-03-22 13:25  ishizhen  阅读(249)  评论(0编辑  收藏  举报