Hi again.

If anyone have a little free time, I will be very grateful if give few
tips about functions.

Thank you, Jakub V.

-------- Original Message --------
Subject:        Re: simple return array from other "code"
Date:   Mon, 26 Apr 2010 08:03:55 +0200
From:   Jakub Viták <main...@gmail.com>
To:     Nakarin Phooripoom <mynameisje...@gmail.com>


Hello Nakarin.

Thank you for quick response - it works :)

On more question.

Could I do same with agents? Or is it better to define var and let other
part
to work with it by global access.

I am still little touched with normal programming :D

Please see my example script - http://pastebin.intuxication.org/202
(your - working way)
and way I would like to have something like this -
http://pastebin.intuxication.org/203

Current error I have, with second example above

[j...@dexter .cfagent]$ cf-agent -I -f ./fun2.cf
cf3:./fun2.cf:18,27: Unknown built-in function gen(), near token ')'
No such FnCall "gen()" in promise @ ./fun2.cf near line 18


If I could summary my problem - I don't know howto make functions and
call them
on demand.


Best regards, Jakub V.


On 04/25/2010 11:58 PM, Nakarin Phooripoom wrote:
> 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


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to