Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 770 Bytes

join.markdown

File metadata and controls

39 lines (28 loc) · 770 Bytes
layout title categories published alias tags
default
join
Reference
Functions
join
true
reference-functions-join.html
reference
data functions
functions
join

Prototype: join(glue, list)

Return type: string

Description: Join the items of list into a string, using the conjunction in glue.

Converts a string of type list into a scalar variable using the join string in first argument.

Arguments:

  • glue : Join glue-string, in the range .*
  • list : CFEngine list identifier, in the range [a-zA-Z0-9_$(){}\[\].:]+

Example:

bundle agent test
{
vars:

  "mylist" slist => { "one", "two", "three", "four", "five" };

  "scalar" string => join("->","mylist");

reports:
  "Concatenated $(scalar)";
}