IP address variable

Joseph Vlcek joseph_vlcek at yahoo.com
Wed Feb 16 17:02:54 UTC 2005



By using the -w swith on the "grep inet" one can eliminate
the return of the v6 addr.

e.g.


# ifconfig eth1|grep -w inet |cut -d ":" -f2|cut -d " " -f1
192.168.1.100

# x=$(ifconfig eth1|grep -w inet |cut -d ":" -f2|cut -d " " -f1)
# echo $x
192.168.1.100
#





--- Bill Gradwohl <bill at ycc.com> wrote:

> Matt Morgan wrote:
> 
> >This would help me out too, so I tried this. I get 127.0.0.1 :-). How
> >can I fix that so that command gives me the address I actually want?
> >man hostname doesn't help me. Thanks.
> >
> >  
> >
> That's simply listing the contents of /etc/hosts in a stripped down IP 
> only form. Normally that file doesn't contain the "real" IP address of 
> the box.
> 
> -- 
> Bill Gradwohl
> bill at ycc.com
> http://www.ycc.com
> spamSTOMPER Protected email
> 
> -- 
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list
> 


=====
Joseph VLcek
Joseph (UNDERSCORE) VLcek (AT) Yahoo (DOT) com




More information about the fedora-list mailing list