Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (17 sloc) 721 Bytes
layout title published tags
default
isvariable
true
reference
utility functions
functions
isvariable

[%CFEngine_function_prototype(var)%]

Description: Returns whether a variable named var is defined.

The variable need only exist. This says nothing about its value. Use regcmp to check variable values. Variable references like foo[bar] are also checked, so this is a way to check if a classic CFEngine array or a data container has a specific key or element.

[%CFEngine_function_attributes(var)%]

Example:

[%CFEngine_include_snippet(isvariable.cf, #+begin_src cfengine3, .*end_src)%]

Output:

[%CFEngine_include_snippet(isvariable.cf, #+begin_src\s+example_output\s*, .*end_src)%]

You can’t perform that action at this time.