On Tue, 6 Feb 2007, Roy Marples wrote:

> This email is about network configuration. Before I joined Gentoo,
> network configuration was done in bash arrays like so (note, that the
> variable name was changed in baselayout-1.11)
> 
> ifconfig_eth0=(
>   "10.1.1.1 netmask 255.255.255.0"
>   "10.1.1.2 netmask 255.255.255.0"
> )
> 
> This is all well and good, but only bash and zsh can use it.

That's not true. Only bash and zsh can *source* it. Aside from the fact 
that most other shells don't have any way of storing the results of 
reading such a file in an accessible way, that format is easy enough to 
parse with a bit of sed.

> Who's got any bright ideas for a new config then? Lets brain storm!

If it's necessary to change at all, I'd vote for sections in square 
brackets, applying to everything until the next square bracket, and lines 
with a key, followed by a ':' or '=', followed by optional whitespace, 
followed by any number of values, optionally in quotes with 
backslash-escaped quotes and backslashes, separated by whitespace, with 
the value lists for duplicate keys being concatenated.

It's not hard to parse (assuming, again, that you have some way to store 
the results), users coming from Windows can write it as "ini" files, users 
who like Java can write it as resource files, and old-school Unix types 
can write RFC822 headers. And they're all mutually comprehensible if the 
parser is just reasonably lenient.

        -Daniel
*This .sig left intentionally blank*
-- 
[email protected] mailing list

Reply via email to