You could get a string from a shell command by execresult() then split the
string up to an slist by splitstring()
##########
vars:
"result" string => execresult("/bin/ls /","noshell");
"split" slist => splitstring("$(result)"," ","100");
reports:
Yr2010::
"Found: $(split)";
##########
Cheers,
--Nakarin
On Apr 25, 2010, at 10:17 PM, Jakub Viták wrote:
> Hi.
>
> I am novice to cfengine and I am trying to understand how it works.
>
> I understand some classes defined "flow", but I would like to know howto
> generate slist
> from command - shell script or even some agent class.
>
> Something like this:
>
> <code>
> vars:
>
> "my_list" slist = generate_somwhere_else();
>
> reports:
>
> "see what I got - $(my_list)"
> </code>
>
> Purpose is to have good decomposition / libraries and build higer logic
> on top of that.
>
> Should somebody help me howto or point me how to solve this, please?
>
> Thanks for answere.
>
> Regards, Jakub V.
>
>
> _______________________________________________
> Help-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine