Re: Suggested dual human/binary interface for proc/devfs

From: George Bonser (grep@shorelink.com)
Date: Tue Apr 11 2000 - 02:40:12 EST


On Tue, 11 Apr 2000, Ed Carp wrote:

> or
>
> device {
> eth0
> ip_address {
> 192.168.201.116
> }
> }
>
> is a complete and total waste of computer cycles to parse with a script, not to mention a pain in the patootie.
>
> But:
>
> device=eth0;ip_address=192.168.201.116,netmask=255.255.255.0
>
> for example, is a LOT easier for a script to parse and use. Add a little whitespace and it's a lot easier for humans to parse, too.
>
> Why are people so damned insistent on making this thing as hard as
> possible to do? Is it sexier or something to make it difficult?

Because your method becomes more difficult when you have more than one
device.

device=eth0;ip_address=192.168.201.116,netmask=255.255.255.0
what do you put here when you want eth1?--------------------^

device{eth0{ip_address=192.168.201.116;netmask=255.255.255.0};eth1{ip_address=192.168.202.117;netmask=255.255.255.0};}

or

device {
        eth0 {
                ip_address=192.168.201.116
                netmask=255.255.255.0
        }
        eth1 {
                ip_address=192.168.202.117
                netmask=255.255.255.0
        }
}

(same thing)

nests better and is more readable and there is already a bunch of code
available to parse this format.

The logic to parse this should be very easy.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:15 EST