ANT question

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?
mdolandAsked:
Who is Participating?
 
objectsConnect With a Mentor Commented:
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
 
CEHJCommented:
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
 
mdolandAuthor Commented:
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
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
objectsCommented:
did u try what I suggested above?

0
 
CEHJCommented:
>>the correct value is printed

What is that value?
0
 
mdolandAuthor Commented:
Great, it works with the property thing. I'm still abit confused why the propertyregex doesn't.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.