I guess that depends on what you mean by multidimensional arrays... :-) But
this works:
body common control
{
bundlesequence => { "test" };
nova_edition::
host_licenses_paid => "5";
}
bundle agent test
{
vars:
"a" string => "a";
"a[1]" string => "a sub 1";
"a[1][foo]" string => "a sub 1 sub foo";
"a[1][baz]" string => "a sub 1 sub baz";
"a[2][bletch]" string => "a sub 2 sub bletch";
"a[2][gar]" string => "a sub 2 sub gar";
"a_idx" slist => getindices("a");
"a_2_idx" slist => getindices("a[2]");
reports:
cfengine_3::
"$(a)";
"$(a[1])";
"$(a[1][foo])";
"$(a[1][baz])";
"$(a[1][missing])";
"$(a[2]) is missing";
"$(a[2][bletch])";
"$(a[2][gar])";
"$(a[2][missing])";
"the indices of a are $(a_idx)";
"the indices of a[2] are $(a_2_idx)";
"a[$(a_idx)] = $(a[$(a_idx)])";
"a[2][$(a_2_idx)] = $(a[2][$(a_2_idx)])";
}
-Dan
On Oct 27, 2010, at 2:45 PM, [email protected] wrote:
> Forum: Cfengine Help
> Subject: Re: Multi-dimensional arrays
> Author: Igor
> Link to topic: https://cfengine.com/forum/read.php?3,13991,18919#msg-18919
>
> is this implemented?
>
> ---
> Igor
>
> _______________________________________________
> Help-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine