Created
October 7, 2013 08:33
-
-
Save seanmtracey/6864483 to your computer and use it in GitHub Desktop.
Really small Shell script for grabbing the local IP of the computer it's run on.
This file contains 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
#!/bin/bash | |
_IP=$(hostname -I) || true | |
if [ " $_IP " ]; then | |
printf "$_IP" | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This has been floating around my projects for a little while, I cannot for the life of me remember where I first found it.