Created
May 24, 2017 08:33
-
-
Save kinshasha/75f48ec5a81f24ff7e0eacf1fa8e232d to your computer and use it in GitHub Desktop.
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
BEGIN { | |
FS="." | |
ex = "false" | |
split(address, ip, ".") | |
} | |
{ | |
split($0, range, "[-.]") | |
for (i=1; i<5; i++) { | |
if (ip[i] < range[i] || ip[i] > range[i+4]) | |
break; | |
else if ((ip[i] > range[i] && ip[i] < range[i+4]) || i == 4) | |
ex = "true" | |
} | |
} | |
END { | |
print ex | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment