Created
February 4, 2019 19:05
-
-
Save joncardasis/cc0e6b6f0e92b7857274ee3f22634e00 to your computer and use it in GitHub Desktop.
Gets the machine's IP address
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
#!/bin/bash | |
IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\ -f2 | awk 'NR==1{print $1}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment