Last active
August 29, 2015 14:27
-
-
Save h2onda/6a8d208f6eee7058c7ff to your computer and use it in GitHub Desktop.
parse /proc/net/netstat
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
#!/usr/bin/env python | |
import sys | |
buf=[] | |
for idx, line in enumerate(sys.stdin.readlines()): | |
buf.append(line.split()) | |
if idx%2: | |
for entry in zip(*buf): | |
print "%s\t%s" % entry | |
buf=[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment