蚂蚁EXEC:重定向标准出来,但没有标准错误 [英] Ant exec: redirecting standard out but not standard error
问题描述
我有一个 EXEC
任务,它的输出,我投入的属性使用 outputproperty
属性。该命令可以打印一些错误到stderr,我不希望被包含在输出中的错误(由于输出被馈送到另一个命令),而是要打印输出给用户。所以我重定向输出和错误到单独的属性和回声
error属性。这似乎样的黑客不得不回声
的错误。是否有可能重定向一个exec的输出,但留在标准错误或标准输出错误?我认为这意味着错误
属性设置为一些神奇的价值,但我想不出该值是什么。
I have an exec
task whose output I am putting into a property using the outputproperty
attribute. The command may print some errors to stderr, I do not want the errors to be included in the output (since the output is being fed into another command) but rather to be printed out to the user. So I am redirecting the output and error into separate properties and echo
the error property. It seems kind of a hack to have to echo
the error. Is it possible to redirect the output of an exec but leave error on stderr or stdout? I assume it means setting the error
attribute to some magical value but I cannot figure out what that value is.
推荐答案
尝试删除错误
或 errorproperty
属性和加入 LOGERROR =真正的
。
Try removing error
or errorproperty
attributes and adding logError="true"
.
请参阅http://ant.apache.org/manual/Tasks/exec.html
这篇关于蚂蚁EXEC:重定向标准出来,但没有标准错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!