canonify
Table of contents
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
- String containing non-identifier characters - in the range:.*
Example:
code
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:
code
R: canonified component == _var_cfengine_bin_cf_serverd
See also: classify(), canonifyuniquely()
.