Forum: CFEngine Help
Subject: Re: Using dist for random selections
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,24500,24508#msg-24508

It's not given me confidence.  I added a counter to the loop to get a better 
understanding.

neil@ettin ~/.cfagent/inputs $ for I in $(seq 1 10); do echo $I; cf-agent -f 
./test.cf; done
1
R: tails: 83 > 50
R: heads: 57 < 51
2
R: heads: 42 < 51
R: tails: 19 > 50
3
R: tails: 41 > 50
R: heads: 10 < 51
4
R: heads: 51 < 51
R: tails: 90 > 50
5
R: heads: 88 < 51
R: tails: 49 > 50
6
R: tails: 58 > 50
R: heads: 23 < 51
7
R: tails: 14 > 50
8
R: tails: 61 > 50
R: heads: 75 < 51
9
R: tails: 39 > 50
R: heads: 8 < 51
10
R: heads: 28 < 51
R: tails: 42 > 50


I think you are right that randomint is invoked with each iteration.  That does 
not seem desirable.  Would anyone from CFHQ care to comment?

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to