nathan r. hruby wrote:
On Fri, 11 Nov 2005, Martin, Jason H wrote:
If yada isn't in the normal path then that might be a problem; I don't
know what PATH will be set to when that happens. Good point.
Err.. right: here's the full real command:
CurrentLoad = ( ExecResult(/bin/sh -c "/bin/cat /proc/loadavg |
/bin/awk '{print $1}' | tr -d '\n'") )
What I'm seeing in 2.1.17 is that everything after "/bin/cat" simply
dissapears and thus no pipeline. eg, run a ps -ef while this is runnning
and the awk and tr are not being executed. The above works in 2.1.14.
I've had similar problems (starting in 2.1.16, I think). I've been able
to workaround it by switching the order of quote nesting; in other words:
thisworks= ( ExecResult(/bin/sh -c 'command1 "quotedarg" | command2') )
but
thisnoworks= ( ExecResult(/bin/sh -c "command1 'quotedarg' | command2") )
In cases where I really neeed single quotes on the inside (as you do in
your awk call), I've generally just punted and written little shell
scripts for cfengine to call. I could probably kludge it with special
variables, but it gets nearly unreadable quickly.
_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine