Created
February 22, 2012 18:09
-
-
Save jdorfman/1886408 to your computer and use it in GitHub Desktop.
Convert an IP Address to a Number using a Bash function
This file contains 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
# 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