Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A network interface status script for GeekTool' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A network interface status script for GeekTool
Authored by: Whosawhatsis on Mar 20, '06 01:23:37PM
Here's a one-liner that /doesn't/ needlessly write to the hard drive and gives the same output in a slightly more consistent format:
ifconfig | awk '/flags=|media|inet / {if (substr($2, 1, 6) == "flags=") printf("\n%s ", $1);
 else if ($1 == "inet") printf("%s ", $2);
 else if ($1 == "media:") printf(substr($0, 9))}' | awk '$1 ~ /^en/'
(Line breaks inserted to avoid stretching the page, they can be removed or left alone.)

---
I was offered a penny for my thoughts, so I gave my two cents... I got ripped off.

[ Reply to This | # ]