I tried:
<propertyregex property="my.property"
override="true"
input="${my.property}"
regexp="\r" replace=""
/>
<propertyregex property="my.property"
override="true"
input="${my.property}"
regexp="\n" replace=""
/>
But it doesn't seem to work on newline/cr stuff... This is nuts, is what I'm
trying to do really all that tough?
________________________________
From: Eric Fetzer <[email protected]>
To: Ant Users <[email protected]>
Sent: Wednesday, August 5, 2009 11:10:36 AM
Subject: sshexec
So sshexec is adding a carriage return to the outputproperty when run from
winders. Is there a way to strip this off of the end of a property in ant?
Here's a small repro:
test.sh:
<!--Begin Code Snip-->
echo "error" | tr '\n' '' | tr '\r' ''
exit 0
<!--End Code Snip-->
testSshExec.xml
<!--Begin Code Snip-->
<project default="main">
<task name="main">
<sshexec host="${ssh.host}"
username="${ssh.user}"
keyfile="${ssh.keyfile}"
passphrase="${ssh.passphrase}"
command="/home/myUser/test.sh"
trust="true"
timeout="1000"
outputproperty="returnValue"
/>
</task>
<echo message="XXX${returnValue}XXX"/>
</project>
<!--End Code Snip-->
Run from winders machine, return is:
main:
[sshexec] Connecting to myUnixBox:22
[sshexec] error
[echo] XXXerror
[echo] XXX
BUILD SUCCESSFUL
Total time: 3 seconds
Thanks,
Eric