Darren Reed wrote:
> Garrett D'Amore wrote:
> ...
>> And, maybe what we need to do is provide structured 'access' via some 
>> kind of helper commands (or those -o switches that we've talked 
>> about).  Yeah, it might be another fork/exec combination compared to 
>> parsing it natively with eval, but I suspect the benefits of 
>> structured access (and reduced bugs!) make up for the minor 
>> performance difference.  (And if performance is an issue, then maybe 
>> shell really is the wrong tool!)
>
> Hmm, are you suggesting that there should be an output mode that is 
> complex,
> such as XML, and that we feed said XML into something else, whereupon we
> describe how we want the XML decoded and then presented as output?

Well, that's one possible interepretation.

But what I had more in mind was something like:

cat myxmloutput
<interface>
<name>hme0</hme>
<netmask>255.255.255.0</netmask>
</interface>

hme0_netmask = `cat myxmloutput  | xml_query -p interface:name=hme0 -o 
interface:netmask`

Yes, its fairly hideous.  But it allows a single common parser to be 
used, that is not bound the limitations of the shell.

    -- Garrett
>
> Darren
>


Reply via email to