Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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