help-cfengine
[Top][All Lists]
Advanced

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

Re: variables in functions like FileExists


From: Paul Krizak
Subject: Re: variables in functions like FileExists
Date: Thu, 01 Dec 2005 16:23:52 -0600
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Does FileExists have the limitation of only accepting full paths? If that's the case, you may need to prepend the variable with a "/", i.e.

have_jdk150 = ( FileExists("/${jdk150_home}") )

Paul Krizak                         5900 E. Ben White Blvd. MS 625
Advanced Micro Devices              Austin, TX  78741
Linux/Unix Systems Engineering      Phone: (512) 602-8775
Microprocessor Solutions Sector


Ed Brown wrote:
Try it without the quotes around the variable in FileExists.


On Thu, 2005-12-01 at 14:25, Viraj Alankar wrote:

Hm, I cannot seem to get the below working with v2.1.16a. It only
works if I don't use a variable in FileExists. Any ideas?

control:
 jdk150_home = ( "/usr/local/java/jdk1.5.0_02" )

classes:
 have_jdk150 = ( FileExists("${jdk150_home}") )


On 11/29/05, Mark Burgess <Mark.Burgess@iu.hio.no> wrote:

It mentions in the docs that you have to use the ${xx} form in
functinos. This is a bug really

M

On Mon, 2005-11-28 at 22:53 -0500, Viraj Alankar wrote:

Is there a way to use variables in functions like FileExists()? For
example, this does not seem to work:

control:
 jdk150_home = ( "/usr/local/java/jdk1.5.0_02" )

classes:
 have_jdk150 = ( FileExists("$(jdk150_home)") )

I would like to avoid duplicating the pathname string, and will be
using this variable elsewhere as well. Is there another way I should
approach this?

Thanks,

Viraj.


_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine



_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine




_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine





reply via email to

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