$ cat ifconfig.sh
#!/bin/bash
ip_addr='ifconfig -a |grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"'
for i in $ip_addr
do
echo "$i"
done
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15498/viewspace-1969146/
,如需转载,请注明出处,否则将追究法律责任。