0
我正在从ant文件执行shell脚本。我想在日志文件'buillog-perform.txt'中捕获shell脚本的stdoutput。 以下是我对代码的摘录。我的完整版本很好。但是shell脚本都不会被执行,也不会在buillog-perform.txt文件中捕获日志。将ant脚本中的exec元素的输出指向日志文件
有人可以帮助我吗?如何收集所有的输出和错误,如果任何shell脚本到这个日志文件?
注:我想要并行执行这个目标,因此使用spawn属性。
<target name="perform"
description="This target for the perform.">
<exec dir="." executable="/bin/sh" spawn="true" output="buillog-perform.txt">
<arg line="-c './abc.sh -c ${arg1}'" />
</exec>
</target>
有在ANT EXEC任务的“输出”属性:请参阅:https://ant.apache.org/manual/Tasks/exec.html –