Re: How to query the computer's ip address?
Rob wrote: 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. Thanks, Rob. If reading the output of ifconfig is really too much trouble for you, then I would suggest writing up a small script or alias to grep the output of ifconfig. Nick ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: How to query the computer's ip address?
On Sun, 8 Feb 2004 21:49, Rob wrote: 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. A computer often has a number of associated ip addreses; so it is a bit difficult. However interfaces usually have a unique address (or at least a prime address) so it makes more sense to think in terms of the ip address of a particular NIC in the machine. So ifconfig is the most reasonable way to find what ip addresses are associated with your computer. Malcolm ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
RE: How to query the computer's ip address?
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]