I am trying to call ssh using the ant exec task from maven. My problem is that I can't figure out how to escape spaces in usernames. I have tried:
<exec executable="sed" failonerror="true" inputstring="stein inge morisbak" outputproperty="username"> <arg value="s/ /\\ /g" /> </exec> <exec executable="ssh" failonerror="true"> <arg value="${username}@localhost" /> <arg value="if [ -f /tmp/test.txt ]; then rm -f /tmp/test.txt ; fi" /> </exec> ... and also: <exec executable="ssh" failonerror="true"> <arg value=""stein inge morisbak"@localhost" /> <arg value="if [ -f /tmp/test.txt ]; then rm -f /tmp/test.txt ; fi" /> </exec> ... and finally: <exec executable="ssh" failonerror="true"> <arg value="'stein inge morisbak'@localhost" /> <arg value="if [ -f /tmp/test.txt ]; then rm -f /tmp/test.txt ; fi" /> </exec> ... but no luck :-( Any ideas? --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org