如何从ant exec任务运行多个命令

问题描述:

我想从Ant exec任务运行两个dos命令.

I want to run two dos commands from Ant exec task.

我尝试了以下代码

<exec dir="${testworkspace}\${moduleName}" executable="cmd" failonerror="true" output="${testworkspace}\${moduleName}\BuildConsole_TC${tc_num}.log" resultproperty="execrc">
                    <arg value="/c echo Download Status is ${DownloadStatus}"/>
                    <arg value="/c Load.bat ${moduleName} ${Intapp} ${CcvStatus}"/>
                </exec>

,但仅执行第一个命令,然后跳过第二个命令. 我正在Windows操作系统上尝试此操作.

but it executes only first command and skips second. I am trying this on windows OS.

这应该有效.只需链接命令即可.

This should work. Simply chaining the commands.

<exec dir="${testworkspace}\${moduleName}" executable="cmd" failonerror="true" output="${testworkspace}\${moduleName}\BuildConsole_TC${tc_num}.log" resultproperty="execrc">
    <arg value="/c echo Download Status is ${DownloadStatus} &amp; Load.bat ${moduleName} ${Intapp} ${CcvStatus}"/>
</exec>