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?
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}"/>
What's the value of



If you are just doing this to fix to Unix path separators, you could probably use those in both Unix and Windows
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.
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.

did u try what I suggested above?

>>the correct value is printed

What is that value?
mdolandAuthor Commented:
Great, it works with the property thing. I'm still abit confused why the propertyregex doesn't.
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.