From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OXs8y-0003Mc-Jr for garchives@archives.gentoo.org; Sun, 11 Jul 2010 08:44:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 80E44E082F; Sun, 11 Jul 2010 08:43:23 +0000 (UTC) Received: from mail.oversi.com (unknown [209.88.189.2]) by pigeon.gentoo.org (Postfix) with ESMTP id 4CFABE08B2 for ; Sun, 11 Jul 2010 08:43:23 +0000 (UTC) Received: from [10.2.2.28] (unknown [10.2.2.28]) by mail.oversi.com (Postfix) with ESMTPA id E98755FE621 for ; Sun, 11 Jul 2010 11:43:21 +0300 (IDT) Message-ID: <4C398429.7070107@oversi.com> Date: Sun, 11 Jul 2010 11:43:21 +0300 From: Amit Dor-Shifer User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net? References: <4C35BF45.1050005@oversi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 16d1d140-f5ec-49ed-a3b5-ef989dc0a5cd X-Archives-Hash: 59ce62786689fbd46828e74fcb47180f On 07/08/10 15:13, Remy Blank wrote: > Amit Dor-Shifer wrote: > >> Can anyone recommend a tool that can parse networking info from a/m >> file, so one can use it to query, e.g. what is the static IP configured >> on eth0? >> > bash? > > No, I'm not joking. The file is a bash script, and hence can just be > sourced by another bash script, which could then print the relevant > information in any desired format. > > -- Remy > > I'll try it out. However, as bash doesn't know net syntax, I'd still have to go the extra-mile for stuff such as extracting IP from the config_ variable, when that also contains a netmask (e.g. CIDR notation or "netmask" definition following the ip). Amit