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 1OXt8m-0002KL-9h for garchives@archives.gentoo.org; Sun, 11 Jul 2010 09:48:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2D6F7E0AFA; Sun, 11 Jul 2010 09:46:55 +0000 (UTC) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) by pigeon.gentoo.org (Postfix) with ESMTP id DA504E0AFA for ; Sun, 11 Jul 2010 09:46:54 +0000 (UTC) Received: by bwz6 with SMTP id 6so2825406bwz.40 for ; Sun, 11 Jul 2010 02:46:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=BudWE14fzhUUwARKvj2v13/VEgPV88EIp9O1yNeiohM=; b=Ib0yd8lF97qetdQH7RAwG7LjyQg/JcY3eOZxoxzsgRgixxBOEgXgPzgmKpGvdVkjXE B4V/+Mc6RwCZftmPADWyXaubKhXNwMsrHO5gHvu54BpCnp6lQy6Nx1Uxw9rMVRhd2+aS all2jjSJpy2obCv1JW9N44fSL0b0AUNKKijdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=qmB3QSfXKSNZBzSmWnHJyITZKZrtFNkKseJCfSTEET1+eQDqsQAkeQXLxn98Kctb+W G0CUXOdeZEEV5XRk72LnmVk6uN8HVI1uGHgf7xLFcpeg6XRlNTuprRrcEmzPJo/rsjPP HESu7/a6vKAqdtLHsvX9kU9ECdi17fud8Vdg0= 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 Received: by 10.204.154.148 with SMTP id o20mr9314127bkw.205.1278841614089; Sun, 11 Jul 2010 02:46:54 -0700 (PDT) Received: by 10.204.76.65 with HTTP; Sun, 11 Jul 2010 02:46:54 -0700 (PDT) In-Reply-To: <4C398429.7070107@oversi.com> References: <4C35BF45.1050005@oversi.com> <4C398429.7070107@oversi.com> Date: Sun, 11 Jul 2010 11:46:54 +0200 Message-ID: Subject: Re: [gentoo-user] Re: OT: tool for reading /etc/conf.d/net? From: Mateusz Arkadiusz Mierzwinski To: gentoo-user@lists.gentoo.org Content-Type: multipart/alternative; boundary=0015175dd49421c068048b19848f X-Archives-Salt: b8f7ac0c-5564-4d0e-902a-e9b70cb52cff X-Archives-Hash: ddc808770fdb7c04aab39b166b1e7181 --0015175dd49421c068048b19848f Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Wrote one in C,C++, Bash, Java or even PHP CLI ?? Try some... :) This file is Bash script. Every line comes with some portion of "variable = =3D variable data". It's realy simple. In PHP you can write simple script using explode functions or regexp's. Good luck 2010/7/11 Amit Dor-Shifer > > > 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, whe= n > that also contains a netmask (e.g. CIDR notation or "netmask" definition > following the ip). > Amit > > --=20 Mateusz Mierzwi=F1ski Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski --0015175dd49421c068048b19848f Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable Wrote one in C,C++, Bash, Java or even PHP CLI ?? Try some... :)

Thi= s file is Bash script. Every line comes with some portion of "variable= =3D variable data". It's realy simple. In PHP you can write simpl= e script using explode functions or regexp's.

Good luck

2010/7/11 Amit Dor-Shifer <= span dir=3D"ltr"><amitds@oversi.com= >
Amit Dor-Shifer wrote:
=A0
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?
=A0 =A0
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

=A0
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" def= inition following the ip).
Amit




--
Mateusz Mierzwi= =F1ski

Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski
--0015175dd49421c068048b19848f--