#!/bin/bash
VAR="eth0"
HOST_IP=$(ifconfig $VAR | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}')
echo $HOST_IP
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/6302.html
#!/bin/bash
VAR="eth0"
HOST_IP=$(ifconfig $VAR | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}')
echo $HOST_IP
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/6302.html