Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
- ret = 0
- n = length(str)
- for (i = 1; i <= n; i++) {
- c = tolower(substr(str, i, 1))
- k = index("123456789abcdef", c)
- ret = ret * 16 + k
- }
- return ret
- } {x=hextodec(substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."hextodec(substr($2,i,2))}{print x":"hextodec(substr($2,index($2,":")+1,4))}'
Add Comment
Please, Sign In to add comment