Matt Emmerton wrote:

I'm messing with ubermon for superkaramba and I want to know how to get my
hosts ip address from the command line (and only the ip address).

I know I can grep and sed rc.conf or the output of ifconfig, but I'm


there's a command like whoami for the ip address.

There isn't anything that simple, but munging the output of ifconfig is what you want. This assumes that your box only has one IP address (other than localhost):

# ifconfig -a | grep "inet " | grep -v | awk ' { print $2 } '

Matt Emmerton

But, for simplicity, if you are on a public host:

$host `hostname`

might do it...

[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to