Andrew DeFaria wrote:
Dave Korn wrote:
Why not the more simple:
ipconfig | grep "IP Address" | awk '{print $NF}'
Because that may return more than one result. And it doesn't choose
the one with the lowest metric, which is most likely to be the primary
gateway to the world-at-large.
By
Dave Korn wrote:
Why not the more simple:
ipconfig | grep "IP Address" | awk '{print $NF}'
Because that may return more than one result. And it doesn't choose
the one with the lowest metric, which is most likely to be the primary
gateway to the world-at-large.
By and large most people hav
David said:
Probably useless if you're behind any kind of NAT device.
Unless you need the external ip address. Sometimes you need the internal
address, but other times you need the external address.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports:
Probably useless if you're behind any kind of NAT device.
--David
-Original Message-
From: Jon A. Lambert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 04, 2006 8:17
To: cygwin@cygwin.com
Subject: Re: Utility to get IP address of the machine
Alex Vinokur wrote:
> What i
Alex Vinokur wrote:
What is Cygwin utility to get IP address of the machine?
Here's another way to get the IP of your machine, from outside your network.
ruby -ropen-uri -e "URI.parse('http://www.whatismyip.com').read =~
/((\d+\.?){4})/; puts $&"
--
J L
Herb Martin wrote:
> While it is almost always more useful to use "Ipconfig
> /all" when working interactively, when one just wants the
> IP addresses just using plain "ipconfig" gets them without
> so much noise to parse through.
Or
perl -MSocket -MSys::Hostname -wle \
'print inet_ntoa
Andrew DeFaria wrote:
> Bernhard Ege wrote:
> --
> It's lonely at the top, but you eat better.
>
>> I use my getip.sh script (windows xp):
>>
>> #!/bin/bash
>> # find default gateways
>> # select the one with the lowest metric
>> ip=`route print | egrep "^ +0.0.0.0 +0.0.0.0 +" | gawk 'BEGIN {
>>
Bernhard Ege wrote:
--
It's lonely at the top, but you eat better.
I use my getip.sh script (windows xp):
#!/bin/bash
# find default gateways
# select the one with the lowest metric
ip=`route print | egrep "^ +0.0.0.0 +0.0.0.0 +" | gawk 'BEGIN {
metric=255; ip="0.0.0.0"; } { if ( $5 < metric )
> If you don't care /which/ one, you can just hard-code
> "127.0.0.1" ;-) but I
> think that's probably not the answer you're looking for.
>
> You may need to parse the output from the windows "ipconfig /all".
>
> cheers,
> DaveK
While it is almost always more useful to use
"Ipco
Alex Vinokur wrote:
What is Cygwin utility to get IP address of the machine?
I use my getip.sh script (windows xp):
#!/bin/bash
# find default gateways
# select the one with the lowest metric
ip=`route print | egrep "^ +0.0.0.0 +0.0.0.0 +" | gawk 'BEGIN {
metric=255; ip=&q
Alex Vinokur wrote:
> What is Cygwin utility to get IP address of the machine?
A machine can have many IP addresses, one for each network interface.
If you don't care /which/ one, you can just hard-code "127.0.0.1" ;-) but I
think that's probably not the answer you
What is Cygwin utility to get IP address of the machine?
--
Alex Vinokur
email: alex DOT vinokur AT gmail DOT com
http://mathforum.org/library/view/10978.html
http://sourceforge.net/users/alexvn
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem
12 matches
Mail list logo