Forum: CFEngine Help Subject: Re: List element extraction fails Author: m...@last.fm Link to topic: https://cfengine.com/forum/read.php?3,27162,27180#msg-27180
If that's the case, I'm missing something. I don't understand the difference between:- "private_ip" string => "$(private[2])"; where I'm extracting a single element from a list formed by matching against the line below. 2: eth0 inet 10.1.1.104/24 brd 10.1.1.255 scope global eth0 This is giving me a 2 element array containing ( "eth0", "10.1.1.104" ), from which I'm having no trouble extracting just the IP address into a string variable. However I can't find any way to make this work:- "base_element" string => "$(nm_elements[1])"; The only difference, as far as I can see, is that in the former case the list is populated by a "class" promise, whereas in this case, the list is populated by a function in a previous "vars" promise. I don't currently see why that difference would cause this to fail, however. Mike _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine