[LBo] looking for command

Billy Pollifrone billy at silverbaseball.com
Sun Mar 18 10:40:13 CET 2007


Ray wrote:
> Hello,
> I'm looking for a command that will provide my own IP address suitable to=
 pass =

> as a commandline paramater to another program. =

> I am aware of ifconfig and arp and if need be I can parse their output, (=
or =

> just do it manually), but if there is an easier way....
> What I want is a command that just returns my internal ip address.
> i.e. command foo -> 192.168.0.104
> is there any such thing?
> Ray
> =


I could do this for ipv4 of my wireless card:

ifconfig wlan0 | grep "inet addr" | sed -e "s/inet addr://" | \
sed -e "s/ Bcast.*//"

Putting it into a shell script should be simple enough

-- =

(o_  Billy Pollifrone
//\  billy AT silverbaseball DOT com
V_/_ Registered Linux User #433318 (http://counter.li.org)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://linuxbasics.org/pipermail/qna/attachments/20070318/500950d0/si=
gnature.pgp


More information about the QnA mailing list