Skip to content

Instantly share code, notes, and snippets.

@joncardasis
Created February 4, 2019 19:05
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 joncardasis/cc0e6b6f0e92b7857274ee3f22634e00 to your computer and use it in GitHub Desktop.
Save joncardasis/cc0e6b6f0e92b7857274ee3f22634e00 to your computer and use it in GitHub Desktop.
Gets the machine's IP address
#!/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