我希望
echo foo | tee /proc/self/fd/{3..6} 3>&1
因/ proc / self / fd / 4之类的错误而失败:没有此类文件或目录等,但令我惊讶的是,它输出
foo
foo
foo
foo
foo
就像3>&1
导致以下所有描述符都重定向到stdout一样,除非如果我更改3
为其他内容则不起作用,例如
$ echo foo | tee /proc/self/fd/{3..6} 4>&1
tee: /proc/self/fd/3: No such file or directory
tee: /proc/self/fd/5: No such file or directory
tee: /proc/self/fd/6: No such file or directory
foo
foo
$ echo foo | tee /proc/self/fd/{4..6} 4>&1
tee: /proc/self/fd/5: No such file or directory
tee: /proc/self/fd/6: No such file or directory
foo
foo
有这种行为的解释吗?