Hi

Apologies if I'm a bit late to the party on this subject, but how do you
reference a specific sub-element of an slist that is a value part of an
associative array? So far all the doco I've read is a bit light on more
"advanced" uses of arrays.

For example, I have the following var defined:

   "foo[keyA]" slist => {"valA","valB"};
   "foo[keyB]" slist => {"valC","valD"};
   "foo[keyC]" slist => {"valE","valF"};

I would like to perform the following:

   "bar[key]" string => "$(foo[$(dynamic_value)][1])";

where `dynamic_value` is the output of an execresult. Is this possible or
am I missing something obvious here? Referencing by scalar for the
purposes of iteration doesn't seem to offer much help here, assuming I
understand it correctly.

Thank you

Steve

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to