Hi,

Silly question, maybe, but is there a simple command to query the computer's
ip address? Something similar to 'hostname' for finding the computer's hostname.
I need the four dot-separated ip numbers.


I can analyze the output of 'ifconfig', but isn't there an easier way.

For the sake of looking for a "command" that might do this, i whipped up this long one-liner:


ifconfig | perl -nle 'print $1 if(/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/)'

note that this will print the first ip address it finds of each line seperated by a newline, so be prepared to handle more than one.
-rian


_________________________________________________________________
Find great local high-speed Internet access value at the MSN High-Speed Marketplace. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/


_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to