【发布时间】:2016-06-02 21:21:21
【问题描述】:
我想将命令“apachectl configtest”的输出记录到文件中。所以我尝试了以下命令:
root@ubuntu:~# echo $(apachectl -t) >> /tmp/apache_config_check
[Sun Feb 21 14:35:23.614947 2016] [proxy_html:notice] [pid 29249] AH01425: I18n support in mod_proxy_html requires mod_xml2enc. Without it, non-ASCII characters in proxied pages are likely to display incorrectly.
Syntax OK
但它给出了空输出:
root@ubuntu:~# cat /tmp/apache_config_check
root@ubuntu:~#
我还尝试了命令本身的变体:
root@ubuntu:~# apachectl -t >> /tmp/apache_config_check
以及 tee 的变体:
root@ubuntu:~# $(apachectl -t) | tee /tmp/apache_config_check
没有运气。
我真的不知道任何其他管道输出的方法,也不知道上述命令失败的原因。这是基本的东西吗?
【问题讨论】:
标签: linux apache apache2 tee piping