将bash stdout/stderr重定向到两个地方?

这个人一直在欺骗我一段时间。是否可以将stdout和stderr重定向到终端输出和程序?

我理解可以将输出重定向一个文件和标准输出tee,但我想要它去一个程序(我的编辑器[TextMate])以及终端输出…肯定这是可能的(我知道它的可能与zsh …)

您可以使用命名管道,该管道用于您所描述的情况。
mkfifo some_pipe
command_that_writes_to_stdout | tee some_pipe \
  & command_that_reads_from_stdin < some_pipe
rm some_pipe

或者,在Bash:

command_that_writes_to_stdout | tee >(command_that_reads_from_stdin)

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...