Patrick McLean ha scritto:
Roy Marples wrote:
Welcome to baselayout-ng which will be a virtual and will not require
bash.

So this means that you are planning to stop development of the current baselayout in favor of baselayout-ng?


We still need something that is "array like" for want of a better
phrase, so how about delimiting using ; like so
config_eth0="10.1.1.1 netmask 255.255.255.0; 10.1.1.2/24"


Couldn't you use the current config on bash shells and parse it to something like that on non-bash. There is no reason why the shell needs to source the config file, it could be parsed just as easily, and writing the parser shouldn't be too hard with a bit of sed magic.

I was thinking to something similar:

with net:
8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
config_eth0=(
"10.1.1.{1..30}/8"
"192.168.0.1 netmask 255.255.255.0"
)

config_eth1=(
        "10.1.2.{1..30}/8"
        "192.168.1.1 netmask 255.255.255.0"
)
8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<

this command:

echo -e $(sed -e 's|=(|<<<|g;s|)|>>>|g' net) | sed -e 's|" "|;|g;s|"||g;s|<<<|="|g;s|>>>|"\n|g'

output something like:

8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<
config_eth0=" 10.1.1.{1..30}/8;192.168.0.1 netmask 255.255.255.0
 config_eth1=" 10.1.2.{1..30}/8;192.168.1.1 netmask 255.255.255.0
8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<

--
[email protected] mailing list

Reply via email to