Cfengine 3 example unit_parsestringarray.html

body common control { bundlesequence => { test("/tmp/test.txt") }; } bundle agent test(f) { vars: ####################################### # Define data inline for convenience ####################################### "table" string => "one: a two: b three: c"; ####################################### "dim" int => parsestringarray( "items", "$(table)", "\s*#[^\n]*", ":", "1000", "200000" ); "keys" slist => getindices("items"); reports: cfengine_3:: "$(keys)"; } }