Forum: CFEngine Help
Subject: Re: CFEngine Help: Re: Using defaults promises
Author: zzamboni
Link to topic: https://cfengine.com/forum/read.php?3,26481,26483#msg-26483

I'll let Mark or others with more insight into the language design pitch in, 
but I know that this is how CFEngine has always behaved: if a variable is not 
defined, then attempting to interpolate it results in the literal string being 
returned, rather than an empty string or something else.

This is not completely unprecedented - for example, in many Unix shells, if you 
try to expand a glob expression that doesn't match any files, the default 
behavior is to return the glob string as is. E.g.:

$ echo doesnotexist*
doesnotexist*

(although admittedly this behavior is also configurable in most shells).

It would probably make sense and be useful to allow other behaviors when an 
undefined variable is used in interpolation.

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

Reply via email to