利用sed 取出ifconfig命令中本机的IPv4地址

[16:27:28 root@centos8 ~]#ifconfig eth0 |sed -En "/inet/s#[^0-9]+([0-9.]+).*#\1#p"|cat -A
10.0.0.150$
posted @ 2023-10-07 13:58  小糊涂90  阅读(16)  评论(0)    收藏  举报