Her is a small c routing that will give you your IP address. Of
course, there are multiple interfaces on a system and this example
will grab the en0 IP address. As I'm sure you are aware, "netstat -
in" will give you a list of interface names.
The problem, as suggested in TN1145 (pointed out by Rustam earlier),
is that on a system like Mac OS X, the OP's goal isn't really
achievable. There is nothing that qualifies as "the" or "my" IP
address on a Mac OS X system.
The best you can hope for is to determine the default interface
(using the SystemConfiguration framework), and select, more or less
at random, one address on that interface.
TN1145 should be really be required reading :-}.
Cheers,
Justin
--
Justin C. Walker, Curmudgeon-at-Large
() The ASCII Ribbon Campaign
/\ Help Cure HTML Email