Mark Burgess wrote:

> [EMAIL PROTECTED] wrote:
> 
> > sorry to rehash an issue, but i'm still not able to get this to work in
> > spite of trying things suggested in previous threads. i've read these
> > threads:
> 
> Looks like you need to sort out your quoting. See changelog 2.1.17 for 
> a example
> 
> result = ( ExecResult("/bin/sh -c \"${pf_cc} -V | head -1 | cut -d 
> -f3\"") )
> 
>         not
> result = ( ExecResult(/bin/sh -c "${pf_cc} -V | head -1 | cut -d  -f3") )
> 
> Or write a module/prepmodule (see docs)

Maybe you have already seen this, but I address the same issue here:

One should avoid complicated quotation. The cfengine parser does not
behave as you might expect it to, and is under continuous revision.
This does not cause problems for simple code, but if you are embedding
complicated shell commands in your cfengine code with ReturnsZero or
ExecResult, expect problems. As recently as 2.1.17, the handling of
function arguments has been changed. It is probably safer to rely on
modules to set classes and define variables, since the language rules
for common interpreters are less likely to change (and if they do, at
least you don't have to worry about it when upgrading cfengine). It
may seem more complicated to break your logic into two files, but that
is the price you pay for component isolation. Also, it is hard to read
embedded code with lots of escaping, so in the long run your code will
probably be more maintainable.

http://praksys.blogspot.com/2005/12/cfengine-best-practices.html

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science

http://www.cs.uchicago.edu/people/brendan
http://praksys.blogspot.com/
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
http://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to