ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Qazwart <qazw...@gmail.com>
Subject Re: How to convert back slashes to forward slashes
Date Fri, 17 Aug 2007 01:15:31 GMT
Instead of doing external calls to Perl, Python, or grep, why not use  
filterChains and filterReaders. You can use the string filter  
ReplaceString in the TokenFilter. See <http://ant.apache.org/manual/ 
CoreTypes/filterchain.html#tokenfilter>.

On Aug 16, 2007, at 7:03 AM, Mike Stewart wrote:

> You can use exec like:
>
>         <exec executable="perl " dir="." failonerror="false"
> failifexecutionfails="false" vmlauncher="false">
> 	    <arg value="-p" />
> 	    <arg value="-e" />
> 	    <arg value=" 's/\\/\\\\/g'" />
> 	    <arg value="<your prop files>" />
>         </exec>
>
> Might have to experiment with the single quotes not sure they are
> required.
>
> Mike S.
>
>>>> brokenconnection@gmail.com 09/08/2007 19:04:25 >>>
> perl ??  I don' t have perl installed....so how would the exec call
> that
> perl function???
>
> On 8/9/07, Chun Ji <CJi@pro-unlimited.com> wrote:
>>
>>
>> If this works for you, maybe you can add an "exec" in your ant xml
> file.
>>
>> " perl -pi -e 's/\\/\\\\/g' <your prop files>"
>>
>>
>> -c
>>
>>
>>
>> -----Original Message-----
>> From: broken connection [mailto:brokenconnection@gmail.com]
>> Sent: Thursday, August 09, 2007 10:40 AM
>> To: Ant Users List
>> Subject: How to convert back slashes to forward slashes
>> Importance: Low
>>
>>
>> Hi Friends,
>> I take a directory path input from the end-user and store it in a
>> property,for example if its windows,it stores it as:
>>
>> log4j.location=C:\tomcat\logs
>>
>> And that messes up everything.Because \t is interpreted as tab. So,
> how
>> can
>> i change the backward slashes(windows convention) to forward
> slashes(unix
>> convention) in the property before my build file is executed????
>>
>> Or, how to escape them eg "\" to "\\"
>>
>> I would appreciate your help.
>> Thanks
>> Mick
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>

David Weintraub
david@weintraub.name
qazwart@gmail.com



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


Mime
View raw message