Skip to content

Instantly share code, notes, and snippets.

@seanmtracey
Created October 7, 2013 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seanmtracey/6864483 to your computer and use it in GitHub Desktop.
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.
#!/bin/bash
_IP=$(hostname -I) || true
if [ " $_IP " ]; then
printf "$_IP"
fi
exit 0
@seanmtracey
Copy link
Author

This has been floating around my projects for a little while, I cannot for the life of me remember where I first found it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment