本文介绍了如何重定向控制台输出到文件,仍然得到它的控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要运行Ant脚本,提示用户输入,所以它需要通过控制台进行交互。同时我要登录控制台内容到日志文件。
我知道我可以使用蚂蚁> build.log 2';&放大器; 1 将重定向到文件,但保留控制台空

I want to run an ANT script which prompts the user for input, so it needs to be interactive through the console. at the same time I want to log the console content to a log file.I know I can use ant >build.log 2<&1 which will redirect to file, but leave the console empty.

那么,如何可以在做什么?需要在Windows和UNIX。

So, how can that be done? needed on windows and unix.

推荐答案

使用 T恤

ant 2>&1|tee build.log

tee.exe也可用于Windows从

这篇关于如何重定向控制台输出到文件,仍然得到它的控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:17
查看更多