[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shellcommand return-value defines
From: |
Mark . Burgess |
Subject: |
Re: shellcommand return-value defines |
Date: |
Wed, 18 Oct 2000 16:11:04 +0200 (MET DST) |
On 21 Sep, Mark R. Lindsey wrote:
>
> Howdy,
>
> I have an application where I need to run a command, and define a
> class if the command returns true.
>
> groups: SometimesDefinedClass = ( "/...some program" )
> doesn't seem to be workable, because I need to define the class at a
> specific point in the cfengine program. Specifically, I (1) perform
> some editfiles, then (2) need to check to see if the edited files have
> a specific property, and define a class if they have that property.
>
> And the `define' parameter on a shellcommands statement doesn't seem
> to be that useful; consider:
> control:
> actionsequence = ( shellcommands )
>
> shellcommands:
> "/bin/true" define=TrueDefined
> "/bin/false" define=FalseDefined
>
> TrueDefined:: "/bin/echo true defined it"
> FalseDefined:: "/bin/echo false defined it"
> With cfengine 1.6.0.a10, both TrueDefined and FalseDefined are defined.
> Thus, I can't tell the exit status of the shell command. (The meaning
> of the define option on a shellcommands statement isn't really
> explained in the tutorial nor in the reference manual.)
>
> Is there a way to do what I need?
>
> Thanks.
>
Looking at this with my current version of cfengine, I see no problem.
Try getting 1.6.0.a12. I believe that no changes to this code have
appeared since a10 however, so I am not sure about this...it works for
me.
Mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: Mark.Burgess@iu.hio.no
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: shellcommand return-value defines,
Mark . Burgess <=