Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在终端中打印stdout和stderr,并重定向到2个不同的文件_Linux_Bash_Stdout_Stderr - Fatal编程技术网

Linux 在终端中打印stdout和stderr,并重定向到2个不同的文件

Linux 在终端中打印stdout和stderr,并重定向到2个不同的文件,linux,bash,stdout,stderr,Linux,Bash,Stdout,Stderr,此问题的答案说明了如何将stdout和stderr打印到终端,同时将它们重定向到文件: program [arguments...] 2>&1 | tee outfile 如果将stdout和stderr重定向到两个不同的文件中,该如何扩展 您试过T形排水口排水口2吗? program >(tee stdout.log) 2>(tee stderr.log >&2)

此问题的答案说明了如何将stdout和stderr打印到终端,同时将它们重定向到文件:

program [arguments...] 2>&1 | tee outfile
如果将stdout和stderr重定向到两个不同的文件中,该如何扩展


您试过T形排水口排水口2吗?
program >(tee stdout.log) 2>(tee stderr.log >&2)