On Thu, 2007-10-25 at 14:31 -0700, Donnie Berkholz wrote:
> Is there any way we could avoid these altogether, and instead use 
> separate variables for each array element?

Well, we could prefix with numbers

array="1.2.3.4 netmask 5.6.7.8;
\*
'host.name' netmask 1.2.3.4
-I 'option; $FOO with spaces'"

Would become

0_config_eth0="1.2.3.4 netmask 5.6.7.8;"
1_config_eth0="\*"
2_config_eth0="'host.name' netmask 1.2.3.4"
3_config_eth0="-I 'option; $FOO with spaces'"

Can't suffix as we use $IFACE and $SSID and sometimes hardware addresses
there. We don't have to have 0_, but we would need the other numbers.
Advantage - no messy holding an array in a string
Disadvantage - you have a big array and need to punt something in the
middle :) OK, you could put a "value" in there but each array loop would
have to know about this magical value.

Thanks

Roy

-- 
[EMAIL PROTECTED] mailing list

Reply via email to