[Shell]获取网卡地址

[root@master2 ~]# INTERNAL_IP=$(ip addr show eth0 | grep "inet " | awk '{print $2}' | cut -d / -f 1)
[root@master2 ~]# echo ${INTERNAL_IP}
10.1.90.182

END

posted @ 2020-10-25 19:44  LeoShi2020  阅读(302)  评论(0编辑  收藏  举报