Created
June 1, 2012 12:36
-
-
Save artyom/2851833 to your computer and use it in GitHub Desktop.
filter out ipv4 ips from stdin/file(s)
This file contains hidden or 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
#!/bin/sh -e | |
cat $@ | tr -cs '0-9\.' '\n' | awk -F'.' 'NF==4 && $1 > 0 && $1<=255 && $2<=255 && $3<=255 && $4<=255 && !/\.\./' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment