Forum: Cfengine Help
Subject: Re: Cfengine Help: Re: creating a list from a list and a var (or even 
2 lists) by interpolation
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,21422,21427#msg-21427

Mikhail Gusarov Wrote:
-------------------------------------------------------
> This won't work due to limitation of Cfengine --
> grep expects _name_ of 
> array as a second argument, so you need a
> temporary variable to gather 
> value returned by splitstring.

You know, that's what I had the first time through, but then I collapsed it 
into a single statement thinking the temp variable was messy. :)

It'd sure be handy if Cfengine could determine whether the last argument was 
the name of a list or a literal list in things like join and grep.  That's been 
one of the challenges in learning the language; sometimes, to pass a list use 
"@(listname)," while other places use "listname".  It seems like, if the 
functions used (or supported) the @(listname) mechanism, then the structure I 
used above would probably also work more like I'd expect.  But I'm probably 
just disoriented because most other languages don't ever ask for the name of a 
variable, but rather the contents or the location of the contents. :)

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

Reply via email to