Marc Hemberger schrieb:
> Hi,
> 
> I have a problem with ExecResult. What I want to do:
> 
> cf.main:     policyhost = ( ExecResult(/bin/hostname -i | /usr/bin/awk
> -F"." '{ print $1"."$2"."$3"."200 }') )
> 
> What it does is:
> 
> cf.main:     policyhost = ( ExecResult(/bin/hostname -i) )
> 
> I.e. it reads the string within ExecResult only to the pipe. The same
> remains true if I change it to ExecResult(/bin/sh -c " ... ").
> 
> Any hints?
> 
> I am using GNU cfengine 2.2.0.
> 
> Greetings,
> 
> Marc

Hello Marc,

I had the same problem with the change from pre 2.1.17 ExecResult to
ExecShellResult. Try to backslash-escape the '$' in the awk statement.
See my last posting in cfengine-help.

Berthold


_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine
  • ExecResult. Marc Hemberger
    • Re: ExecResult. Berthold Cogel

Reply via email to