我正在编写一个 bash 脚本,需要重定向stdout
and stderr
我运行到单个文件的命令的输出,在每行前面加上前缀stderr
or stdout
, 因此。
有没有一个简单的方法可以做到这一点?
, from Debian http://www.debian.org/'s 开发脚本 http://packages.debian.org/sid/devscripts, 做这个。
其手册页中的示例:
$ annotate-output make
21:41:21 I: Started make
21:41:21 O: gcc -Wall program.c
21:43:18 E: program.c: Couldn't compile, and took me ages to find out
21:43:19 E: collect2: ld returned 1 exit status
21:43:19 E: make: *** [all] Error 1
21:43:19 I: Finished with exitcode 2
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)