Create a gist now

Instantly share code, notes, and snippets.

An example of how to do complex conditionals in CFEngine
#pseudocode
if x == 7 and (y<10 or y>20):
do something
#using classes
or_class_set or => {"less_than_ten", "greater_than_twenty"};
and_class_set and => {"or_class_set", "equals_seven"};
#is the same as
and_class_set and => {"equals_seven", "less_than_ten|greater_than_twenty"};
#using expressions
or_class_set expression => "less_than_ten|greater_than_twenty";
and_class_set and => "or_class_set.equals_seven";
#is the same as
and_class_set expression => "equals_seven.(less_than_ten|greater_than_twenty)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment