Trumpet for multiple files but not stdout

I want to pass stdout to multiple files, but save stdout by itself. tee is close, but it prints both files and stdout

 $ echo 'hello world' | tee aa bb cc hello world 

It works, but I would prefer something simpler if possible

 $ echo 'hello world' | tee aa bb cc >/dev/null 
+9
source share
2 answers

You can simply use:

 echo 'hello world' | tee aa bb > cc 
+11
source

You can also close tee stdout output by writing to /dev/full

 echo 'hello world' | tee aa bb cc >/dev/full 

or by closing standard output.

 echo 'hello world' | tee aa bb cc >&- 

However, remember that you will receive either tee: standard output: No space left on device or tee: standard output: Bad file descriptor invalid tee: standard output: Bad file descriptor warnings tee: standard output: Bad file descriptor .

+1
source

All Articles