8 msgemerge of glibc and gcc fails
10 msgProblem using the pppoe plugin
3 msg{OT} preforking mysqld?
10 msgeth0 fallback configuration is ignored
4 msgWhat should i use instead of /dev/usb?
4 msgDisk ARchiver command line questions
3 msgQuestion re desktop-file-utils
4 msgcompiz-fusion, emerald and xfce
4 msgssl timeout when downloading file(s)
1 msgopenoffice hangs (openoffice-bin a little bette...
1 msgkernel 2.6.23 CFS problem?
2 msggnome-art crash
3 msgmobo onboard Intel graphics
6 msgsmartctl strangeness
4 msgSetting up a local portage/rsync mirror on OpenBSD
5 msgNetworking Issue

Finding local IPs
\ Bertram Scharpf (25 Oct 2007)
. \ Arturo 'Buanzo' Busleiman (25 Oct 2007)
. \ Ricardo Saffi Marques (25 Oct 2007)

8 msgemerge stalls - what to do ?
15 msgpam limits
1 msgThunderbird - filters broken
Subject:Re: Finding local IPs
Group:Gentoo-user
From:Ricardo Saffi Marques
Date:25 Oct 2007


 

Hi Bertram.

I've tried some stuff here and ended up with this:

ifconfig | egrep "inet addr" | cut -d ":" -f 2 | cut -d " " -f 1


It's not pretty, but certainly works.

Regards,

Saffi

On 10/25/07, Bertram Scharpf <lists> wrote:
>
>
> Hi,
>
>
> in some script I need all the local IP addresses of a host,
> as there are 127.0.01, 192.168.8.1, ...
>
> I can do this using the command suite
>
> LANG= /sbin/ifconfig | awk '/\<inet\>/{split($2,a,":");print a[2]}'
>
> As this is quite long I would like to ask whether there is
> some smarter way to do it.
>
> Thanks in advance,
>
> Bertram Scharpf


--
*Ricardo Saffi Marques*
Laboratório de Administração e Segurança de Sistemas (LAS/IC)
Universidade Estadual de Campinas (UNICAMP)
*Cell:* +55 (19) 8128-0435
*Skype:* ricardo_saffi_marques
*Website:* *http://www.rsaffi.com*


© 2004-2008 readlist.com