Created
September 19, 2014 12:49
-
-
Save neilhwatson/5353cae3fc2c76ae9af8 to your computer and use it in GitHub Desktop.
CFEngine comparing two numbers using strcmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
neil@ettin ~/.cfagent/inputs $ cat equalto.cf | |
body common control | |
{ | |
bundlesequence => { | |
"main", | |
}; | |
} | |
bundle agent main | |
{ | |
methods: | |
"any" usebundle => test; | |
} | |
bundle agent test | |
{ | |
vars: | |
"one" int => "1"; | |
"uno" int => "1"; | |
classes: | |
"PASS" | |
expression => strcmp( "${one}", "${uno}" ); | |
reports: | |
PASS:: | |
"PASS ${one} == ${uno}"; | |
!PASS:: | |
"FAIL ${one} != ${uno}"; | |
} | |
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./equalto.cf | |
R: PASS 1 == 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment