ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Fetzer <elstonk...@yahoo.com>
Subject sshexec
Date Wed, 05 Aug 2009 17:10:36 GMT
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


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message