As we said in the preface to the first edition, C 'wears well as one's experience with it grows.' With a decade more experience, we still feel that way.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Here's a Python version. We're going for the longest one-liner, right?:
ryant@spitfire:~$ ifconfig | python -c "import sys; import re; print re.match(re.compile('.*addr:([0-9\.]*)\s.*'), [ln for ln in sys.stdin.readlines() if ln.find('inet')>=0][0]).group(1)" 192.168.10.104Reply To This Comment