我可以做
$./a.out 1>stdout_file 2>stderr_file
但是我在屏幕上什么也看不到。或者我可以做
$./a.out | tee log.log
但随后stdout和stderr会转到同一个文件。
我怎样才能做到这两点?
这对你有用吗?(我假设你在Linux上使用bash,不确定其他shell(:
./a.out 1> >(tee stdout.log) 2> >(tee stderr.log)