Fastest way - dump into PHP, use some explodes and regexps.
Most secured - App i C++ or C.
Balanced Way - JAVA app :)
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 = variable data". It's realy simple. In PHP you can write simple script using explode functions or regexp's.
Good luck2010/7/11 Amit Dor-Shifer <amitds@oversi.com>
On 07/08/10 15:13, Remy Blank wrote:
Amit Dor-Shifer wrote:I'll try it out.
Can anyone recommend a tool that can parse networking info from a/mbash?
file, so one can use it to query, e.g. what is the static IP configured
on eth0?
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
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
--
Mateusz Mierzwiński
Bluebox Software http://www.blueboxsoft.pl/mateusz-mierzwinski