将标准输出与标准错误输出的文件描述符路径调换的例子,有需要的朋友不妨参考下。
复制代码代码如下:
[root@station ~]# adfasdf | cat
(责任编辑:IT)-bash: adfasdf: command not found [root@station ~]# adfasdf | cat > 123.txt -bash: adfasdf: command not found [root@station ~]# cat 123.txt [root@station ~]# adfasdf 3>&1 1>&2 2>&3- | cat > 123.txt [root@station ~]# cat 123.txt -bash: adfasdf: command not found |