help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ReturnsZero(): command does not return zero. Is class created with v


From: Mark . Burgess
Subject: Re: ReturnsZero(): command does not return zero. Is class created with value of false?
Date: Wed, 1 Oct 2003 07:33:42 +0200 (MEST)

Like this:

control:

 var = ( Exec(grep) )

classes:

 result = ( StrCmp("$var","0") )


http://www.cfengine.org/docs/cfengine-Reference.html#Evaluated%20classes


M

On  1 Oct, Systems Administrator wrote:
> On Wed, 1 Oct 2003 Mark.Burgess@iu.hio.no wrote:
> 
>> 
>> I'm sorry -- I didn't read this properly first time
>> around. the problem is a misunderstanding of the ReturnZero()
>> function. It is the value of the shell returncode that is tested
>> not the value of the text string printed by the command.
>> You will need to use StrCmp("0",$returnvar) if you want to test that.
> 
>       Hopefully you'll forgive a newbie question.  But first, let me 
> state what I understand you to be implying.  If I understad, you're saying 
> that the StrCmp works assuming that the text output of the fgrep is in the 
> variable $returnvar.  
>       Now for the question: is $returnvar a special variable that is set 
> to the output of the previous shell command?  If not, then how do I set 
> it?  I've looked in the likely places I could find in the manual, and 
> couldn't find anything.  
> 
>       Thanks,
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

[Prev in Thread] Current Thread [Next in Thread]