help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

List as a key in array


From: Jon-Finngard Moe
Subject: List as a key in array
Date: Mon, 23 Jan 2006 07:29:24 +0100
User-agent: Mutt/1.4.2.1i

If have come to a stage when i need to pass on the different entries in a list 
as keys in an array.

I have:
PATCHES_COMMON     = ( cpio.patch:ee.patch )

And:
PATCHDIRS_COMMON   = ( A(cpio.patch,"/usr/src/gnu/usr.bin/cpio")
                       A(ee.patch,"/usr/src/usr.bin/ee") )

What i now want to do is to pass both the filename of the patch (in 
PATCHES_COMMON) and
use each value to retrieve the corresponding patch-directory from the array. Is 
this possible in any way 
with cfengine?

When using this command, ${PATCHES_COMMON} expands successfully. But when 
passed on as 
a key, cfengine passes the whole list as a string instead of each, unique entry.

shellcommands:
        freebsd::
          "$(masterfiles)/patches/patch_common.sh ${PATCHES_COMMON} 
${PATCHDIRS_COMMON[${PATCHES_COMMON}]}"


From output:

cf:cfengine::/var/cfengine/inputs/os/cf.patch_freebsd:77: Non identifier 
character (.) in variable 
identifier (PATCHDIRS_COMMON[cpio.patch:ee.patch])


-- 

Jon-Finngard Moe                   Email: address@hidden
mnemonic AS, Wergelandsveien 25         Mob  : +47 98 64 58 62
N-0167 Oslo, Norway                     Tlf  : +47 23 20 47 45 
                                        Fax  : +47 23 20 47 01
PGP key EEAADBBA available from pgp.mit.edu

Attachment: pgprbgALFtsjY.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]