On Tue, 2005-03-15 at 09:42 -0500, nathan r. hruby wrote: > On Tue, 15 Mar 2005, Mark Burgess wrote: > > > > >> control: > >> MailQueueCount = ( ExecResult(find /var/spool/mqueue -type f -name 'q*' > >> | wc -l ) > >> > >> classes: > >> MailqueOverLimit = ( ReturnsZero(/usr/bin/test $(MailQueueCount) -ge > >> 12) ) > >> > >> Warning; completely untested, but it hopefully indicates the way I > >> was thinking. Mark, does this mean that boolean operations would be a > >> good idea in cfengine? > > > > I don't know what you mean by a boolean operation. > > > > Well, at least a few additional "operators" like "less than" or "greater > than" which return true/false to set a class to prevent this kind of > senseless abuse of fork() :) > > control: > x = ( ExecResult( something-big ) ) > y = ( ExecResult( something-small ) ) > > classes: > XisBiggerThanY = ( GreaterThan( $(x) $(y) ) ) > > Yeah, this looks perl-esque, but I think a few extra operators would be > handy (We already have a substr() ).. I see there are already tests like > this in the cmp= operator for packages: and bymatches= for processes: so > it might make sense to refactor that code into something for more general > use?
Ah - I see. Yes, this is easily added. There are things like strcmp already, but tell me what you want and I'll try to add them before next release. M _______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine