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


Click here to return to the 'A suggested code modification' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A suggested code modification
Authored by: bomolub on Sep 01, '06 01:43:55PM
I modified the function get_ip in "functions.sh":


get_ip ()
{
ifconfig $1 2>&1 | grep inet | grep -v inet6 | awk '{print $2}'
}

This hides stderr messages; before doing this I was getting an output from "ipinfo.sh" like the following:

Public: XXX.XXX.XXX.XXX
Loopback: 127.0.0.1 / 255.0.0.0
Wired: 10.0.0.101 / 255.255.255.0
ifconfig: interface en1 does not exist
Gateway: 10.0.0.1
Nameserver: 10.0.0.1

The error message occurred when the script was looking for an Airport (en1), which I don't have.

[ Reply to This | # ]

A suggested code modification
Authored by: jmdevaney on Sep 01, '06 01:58:34PM

Very nice, both of my machines have airport cards so I never hit that bug... thanks.

---
Jdevaney



[ Reply to This | # ]