in reply to Re: localhost IP in a dollar sign
in thread localhost IP in a dollar sign

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^3: localhost IP in a dollar sign
by Random_Walk (Prior) on Aug 12, 2004 at 16:31 UTC
    What does the hostname command return on your system ? If this is returning localhost you will get 127.0.0.1 as the related IP.

    My idea is to find the machines hostname then use gethostbyname to return the IP address (in a binary form). gethostbyname is using your OS' idea of name resolution so this will have to work (try to ping your own host). The unpack splits this into four decimal fields and the join prints them all out with dots between.