Skip to content

Instantly share code, notes, and snippets.

@rberrelleza
Created January 25, 2013 02:39
Show Gist options
  • Save rberrelleza/4631287 to your computer and use it in GitHub Desktop.
Save rberrelleza/4631287 to your computer and use it in GitHub Desktop.
Script to get the ip of a machine assigned to a variable on UBUNTU.
MACHINE_IP=`ifconfig eth0 | grep inet | grep -v inet6 | awk '{print substr($2, 6)}'`
echo $MACHINE_IP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment