Gentoo Archives: gentoo-user

From: Bertram Scharpf <lists@×××××××××××××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Finding local IPs
Date: Thu, 25 Oct 2007 18:53:52
Message-Id: 20071025184809.GA15317@bart.bs.l
1 Hi,
2
3
4 in some script I need all the local IP addresses of a host,
5 as there are 127.0.01, 192.168.8.1, ...
6
7 I can do this using the command suite
8
9 LANG= /sbin/ifconfig | awk '/\<inet\>/{split($2,a,":");print a[2]}'
10
11 As this is quite long I would like to ask whether there is
12 some smarter way to do it.
13
14 Thanks in advance,
15
16 Bertram Scharpf
17
18
19 --
20 Bertram Scharpf
21 Stuttgart, Deutschland/Germany
22 http://www.bertram-scharpf.de
23 --
24 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Finding local IPs Arturo 'Buanzo' Busleiman <buanzo@××××××××××.ar>
Re: [gentoo-user] Finding local IPs Ricardo Saffi Marques <saffi@××××××××××××××.br>