ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: Escapign backslash in java.home
Date Mon, 15 Nov 2004 14:55:45 GMT
What is wrong with the following?
  <target name="h">
    <concat destfile="x.txt">
      java.home is ${java.home}
    </concat>
  </target>

If you wanted to replace \ with \\, you could use a scriptfilter:
    <concat destfile="x.txt">
      <filterchain>
        <scriptfilter language="beanshell">
          self.setToken(self.getToken().replace("\\", "\\\\"));
        </scriptfilter>
      </filterchain>
      \a\b\c
    </concat>

Peter

Thomas Saxtoft wrote:

>On a Windows XP I have to write the java.home property to a file, but
>doing that the '\' disappears. I suspect that it needs to be escaped
>like '\\', but the value of java.home is the one that contains the
>backslash.
>How do I write it to the file?
>
>The next thing is, how do I make it general so that it also works on a
>Linux machine?
>
>Thanks in advance,
>
>Thomas
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message