Guest User

Untitled

a guest
Feb 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
  2. ret = 0
  3. n = length(str)
  4. for (i = 1; i <= n; i++) {
  5. c = tolower(substr(str, i, 1))
  6. k = index("123456789abcdef", c)
  7. ret = ret * 16 + k
  8. }
  9. return ret
  10. } {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