help-cfengine
[Top][All Lists]
Advanced

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

RE: undefined variable test


From: Andrews, Martin
Subject: RE: undefined variable test
Date: Mon, 13 Jan 2003 22:12:42 -0500

I've just been messing with it - IsDefined() - like so:

groups:
  have_myvar = ( IsDefined(myvar) )

shellcommands:
  have_myvar::
  "/bin/echo myvar is $(myvar)"

I had been hoping to use it to get default values for variables like this:

control:
  !IsDefined(basedir)::
  basedir = ( /opt )

Alas, it appears you can only use IsDefined() in groups definitions and
those are evaluated after the control section. I could probably work around
it with imports but that is nasty. Any chance of widening the availability
of IsDefined() Mark?

Martin
martin.andrews@lionbioscience.com

> -----Original Message-----
> From: Luke A. Kanies [mailto:luke@madstop.com]
> Sent: Monday, January 13, 2003 8:21 PM
> To: help-cfengine@gnu.org
> Subject: undefined variable test
> 
> 
> Hi,
> 
> I swear there is some test I can do to see if a variable is defined in
> cfengine, but I can't find it.  I've looked through the Tutorial,
> Reference, and example files and just can't find it.
> 
> Is there such a thing, and if so, what is it?
> 
> Thanks,
> Luke
> 
> -- 
> Death and taxes are inevitable; at least death doesn't get worse every
> year.
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 




reply via email to

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