[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

ANT question

Posted on 2006-05-29
6
Medium Priority
?
1,393 Views
Last Modified: 2009-07-29
I wan tto insert a value from a variable to a property. THis is how I do it:

<propertyregex property="restoredir" override="true" input="${env.DEV_HOME}" regexp="\\" replace="/" />

On Windows(Ant vers 1.6.5) it works, but on Linux(Ant vers. 1.6.2) it doesn't.

On Linux I instead get ${restoredir} back on the echo command. What is wrong and what do I need to do to get it to work?
0
Comment
Question by:mdoland
  • 2
  • 2
  • 2
6 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 16784387
What's the value of

env.DEV_HOME

?

If you are just doing this to fix to Unix path separators, you could probably use those in both Unix and Windows
0
 
LVL 92

Accepted Solution

by:
objects earned 450 total points
ID: 16786801
env does not work on all OS, though the lattest release works on Linux flavours I've used.

Try the following and l;et me know the result

<property name="restoredir" value="${env.DEV_HOME}"/>
0
 

Author Comment

by:mdoland
ID: 16788034
The thing is that when I do an echo from the same ant script on the env.DEV_HOME, the correct value is printed, so it is there somehow. However, when I try to set it in the way I described, it appears as if it has never been run at all.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 92

Expert Comment

by:objects
ID: 16788058
did u try what I suggested above?

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 16788067
>>the correct value is printed

What is that value?
0
 

Author Comment

by:mdoland
ID: 16789230
Great, it works with the property thing. I'm still abit confused why the propertyregex doesn't.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question