小编cat*_*ith的帖子

为什么`echo 'hi' | tee > abc` 创建多个文件,而 `echo 'hi' > abc` 则不创建多个文件?

我的环境:zsh,macOS


相关命令:

  1. echo 'hi' | tee > a b c
  2. echo 'hi' > a b c
  • 命令 1 创建名为abc内容为 的文件hi
  • a命令 2 创建一个名为content 的文件hi b c

AFAIK,只有 Command 1 的用法没有 >记录在联机帮助页中tee

echo 'hi' | tee a b c
Run Code Online (Sandbox Code Playgroud)

我需要一些帮助来理解为什么添加>上述代码(即命令 1)仍然会创建多个文件,而命令 2 只创建一个文件。

zsh io-redirection tee

19
推荐指数
3
解决办法
2789
查看次数

标签 统计

io-redirection ×1

tee ×1

zsh ×1