On Fri, Oct 28, 2016 at 10:41 PM, Johan Corveleyn <jcor...@gmail.com> wrote: ... > Yes, that works perfectly! On Solaris 11, with your latest version of > the ant wrapper. When I run your test.sh, with the test.xml, I get > exactly the correct output. > > However, with esc_tool=awk it fails. Don't know why yet, but the first > property makes it fail already: > > [[ > bash-4.1> ./ant.new > "-Dfoo=dollar\$_backtick\`_single'_double\"_trailingbackslash\\" -f > test.xml > Buildfile: build.xml does not exist! > Build failed > ]] > > With -version there is no problem, and running with '-f test.xml' > without properties also works (and fwiw, "-Ddoublespace= " also > works).
Okay, so the problem with the awk variant on Solaris is only with the trailing backslash. If I remove that from the test input, all other tests work. This change (doubling the backslashes even more) seems to fix it, but I have no idea if it breaks the awk variant on other platforms: [[ bash-4.1> diff ant.new ant.new.edited 63c63 < esc_arg="$(printf '%s' "$esc_arg" | "$awk_exec" '{ gsub(/\\/, "\\\\"); print }' )" --- > esc_arg="$(printf '%s' "$esc_arg" | "$awk_exec" '{ gsub(/\\/, > "\\\\\\\\"); print }' )" ]] Here is output of the awk variant with your version: [[ bash-4.1> ./ant.new --execdebug "-Dfoo=trail\\ingbackslash\\" -f test.xml arg : -Dfoo=trail\ingbackslash\ quoted_arg: "-Dfoo=trail\ingbackslash\" arg : -f quoted_arg: "-f" arg : test.xml quoted_arg: "test.xml" exec "$JAVACMD" -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=140m -classpath "$LOCALCLASSPATH" -Dant.home="$ANT_HOME" -Dant.library.dir="$ANT_LIB" org.apache.tools.ant.launch.Launcher -cp "$CLASSPATH" "-Dfoo=trail\ingbackslash\" "-f" "test.xml" Buildfile: build.xml does not exist! Build failed ]] And with ant.new.edited: [[ bash-4.1> ./ant.new.edited --execdebug "-Dfoo=trail\\ingbackslash\\" -f test.xml arg : -Dfoo=trail\ingbackslash\ quoted_arg: "-Dfoo=trail\\ingbackslash\\" arg : -f quoted_arg: "-f" arg : test.xml quoted_arg: "test.xml" exec "$JAVACMD" -Xmx512m -Djava.awt.headless=true -XX:MaxPermSize=140m -classpath "$LOCALCLASSPATH" -Dant.home="$ANT_HOME" -Dant.library.dir="$ANT_LIB" org.apache.tools.ant.launch.Launcher -cp "$CLASSPATH" "-Dfoo=trail\ingbackslash\" "-f" "test.xml" Buildfile: /data/tools/ant/apache-ant-1.9.7/bin/test.xml run: [echo] hello world [echo] foo=trail\ingbackslash\_ [echo] bar=${bar}_ [echo] nl=${nl}_ [echo] nlnl=${nlnl}_ [echo] nlnlnl=${nlnlnl}_ [echo] doublespace=${doublespace}_ [echo] end BUILD SUCCESSFUL Total time: 0 seconds ]] -- Johan --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org