我想使用tee附加到多个文件,但是,我不需要将它打印到我的shell中,只需将文件打印即可。输出到/dev/null效果很好,因为该命令仍会追加到文件中,并且不会打印到shell:

echo test | tee -a file1 file2 file3 &>/dev/null

我只是想知道这是否是正确的方法,因为tee --help似乎没有要打印到shell的参数:
  -a, --append              append to the given FILEs, do not overwrite
  -i, --ignore-interrupts   ignore interrupt signals
  -p                        diagnose errors writing to non pipes
      --output-error[=MODE]   set behavior on write error.  See MODE below
      --help     display this help and exit
      --version  output version information and exit

我很确定这是正确的方法,我想我想确认一下。

最佳答案

那好吧...

... | tee -a file1 file2 >> file3

关于linux - 不使用tee命令打印到 shell 的正确方法,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/36904272/

10-14 02:23