comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: get localhost ip address
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: get localhost ip address [message #78605] Tue, 06 December 2011 21:29
Giorgio is currently offline  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 Go to previous message
Brian Wolven is currently offline  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}"
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: get localhost ip address
Next Topic: Constructing integer variables from two bytes?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:49:24 PDT 2025

Total time taken to generate the page: 0.00466 seconds