Skip to content

Instantly share code, notes, and snippets.

@jdorfman
Created February 22, 2012 18:09
Show Gist options
  • Save jdorfman/1886408 to your computer and use it in GitHub Desktop.
Save jdorfman/1886408 to your computer and use it in GitHub Desktop.
Convert an IP Address to a Number using a Bash function
# insert in .bashrc or .bash_profile & run source ~/.bashrc
function aton {
echo "SELECT INET_ATON('$1');" |mysql -uanonymous > /tmp/aton
awk "NR==2" /tmp/aton
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment