Hello,
I just wanted to double-check with you guys if using a var inside a command really doesn't work in CFEngine3.
Example :
vars:
"java_binary" string => execresult("/bin/ls -l /usr/java/*/bin/java | /usr/bin/awk '{print $9}' | /bin/sed ':a;N;$!ba;s/\n/,/g'", "useshell");
"java_binary_list" slist => splitstring("$(java_binary_list)",",","20");
commands:
"/sbin/paxctl -C $(java_binary_list)";
The java_binary_list slist var is being populated with the content I want it to be populated with just fine.
Additionally, I would like to be able to use it under the commands section. When running cf-agent manually in verbose mode, I can see that a string $(java_binary_list) is being passed to the to the /sbin/paxctl binary instead of each value of the java_binary_list var (using implicit loop).
cf3> -> Executing '/sbin/paxctl -C $(java_binary_list)' ...(timeout=-678,owner=-1,group=-1)
cf3> !! Finished command related to promiser "/sbin/paxctl -C $(java_binary_list)" -- an error occurred (returned 1)
Is it true that a var can't really be used like this, inside a command in the commands section ?