Created attachment 25589 [details] Ant 1.8.1 SSHExec.java, modified to include new parameter StripLastCharacter As described on the ant users list in August 2009, http://old.nabble.com/sshexec-td24832653.html output from sshexec includes a newline at the end. This creates difficulties when the output is intended for later use. To give an example, I have an Ant build that needs to find a process ID. I do this with the sshexec task by executing: ps -ef | grep -v grep | grep ${mysearchstring} | awk '{ print $2 }' This gives me a process ID, but also a newline at the end, which I must then remove using a stripLastChar macrodef. It would be far more convenient if there was an option in the sshexec task to strip this last character out of the output. Attached is a version of SSHExec.java, created by modifying Ant 1.8.1, which has this parameter and strips the last character out as required. Maybe you could consider this for inclusion in the next release of Ant?
it would probably be more useful and more general if the task supported a nested redirector like <exec> does. This way you could plug in your own filterchain and could even do away with your "grep"s.