Re: get localhost ip address [message #78605] |
Tue, 06 December 2011 21:29 |
Giorgio
Messages: 31 Registered: March 2008
|
Member |
|
|
On Dec 6, 2:28 pm, Brian Wolven <brian.wol...@gmail.com> wrote:
> Public/WAN or private/LAN? What OS? On unix or mac, you can spawn the following:
>
> curl whatismyip.org
>
> On OS X the following works to give your LAN IP, I'm not sure if this works on other unix-based systems:
>
> ifconfig | grep broadcast | awk "{print \$2}"
I was hopping to use a platform independent command within IDL,
something perhaps that uses socket or idlneturl object. I would like
to avoid spawn.
I could do ifconfig, but it will platform dependent.
The background is to implement a configuration file which depends on
which computer are you. I am using a linux with ubuntu 11.04 at home
and a windows 7 at work. Some colleagues have mac OS X. We have a
server with the data but we usually create a local copy to work on it
and push the changes at the end of the day.
|
|
|
Re: get localhost ip address [message #78606 is a reply to message #78605] |
Tue, 06 December 2011 14:28  |
Brian Wolven
Messages: 94 Registered: May 2011
|
Member |
|
|
Public/WAN or private/LAN? What OS? On unix or mac, you can spawn the following:
curl whatismyip.org
On OS X the following works to give your LAN IP, I'm not sure if this works on other unix-based systems:
ifconfig | grep broadcast | awk "{print \$2}"
|
|
|