Prototype: canonify(text)

Return type: string

Description: Convert an arbitrary string text into a legal class name.

This function turns arbitrary text into class data.

Arguments:

  • text: string, in the range: .*

Example:

body common control
{
      bundlesequence => { "example" };
}

bundle agent example
{
  vars:
      "component" string => "/var/cfengine/bin/cf-serverd";
      "canon" string => canonify("$(component)");

  reports:
      "canonified component == $(canon)";
}

Output:

R: canonified component == _var_cfengine_bin_cf_serverd

See also: classify(), canonifyuniquely().