Re: simple return array from other "code"

2010-04-30 Thread Jakub Viták
Thank you Nakarin .. a lot! On 04/30/2010 11:54 AM, Nakarin Phooripoom wrote: > I'm afraid you can't make functions (like a normal programming does) in > cfengine. > > To get closed to your expectation, you might need to create global variables > (bundle common) of the outputs of your commands/s

Re: simple return array from other "code"

2010-04-30 Thread Nakarin Phooripoom
ate common slist variable over local variables so you need to pass a global slist variable to a local one in your bundle. Cheers, --Nakarin On Apr 27, 2010, at 4:24 PM, Jakub Viták wrote: > Hi again. > > If anyone have a little free time, I will be very grateful if give few > tips abo

Fwd: Re: simple return array from other "code"

2010-04-27 Thread Jakub Viták
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 To:

Re: simple return array from other "code"

2010-04-25 Thread Nakarin Phooripoom
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)"; ##

Fwd: simple return array from other "code"

2010-04-25 Thread Jakub Viták
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: vars: "my_list" slist = generate_somwhere_else(); repor