Created
February 27, 2014 22:15
-
-
Save drjova/9260793 to your computer and use it in GitHub Desktop.
Return my IP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_ip() # Get IP adress on ethernet. | |
{ | |
MY_IP=$(/sbin/ifconfig en0 | awk '/inet/ { print $2 } ' | | |
sed -e s/addr://) | |
echo ${MY_IP:-"Not connected"} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment