Well, 'tee' does not take command names – it takes file names. You're writing copies of the output to files named nc
, localhost
, and 5100
in the current directory.
If you want to run two commands, check if your shell allows "process substitution" using >( ... )
, automatically passing a pipe as the file name:
raspivid <etc> | tee >(nc localhost 5100) | nc localhost 5000
Alternatively, install pee
from moreutils:
raspivid <etc> | pee "nc localhost 5100" | nc localhost 5000
If neither of those options are available, use mkfifo
to create a named pipe for one of the 'nc' instances, then run the output and the input separately:
mkfifo /tmp/ncpipe
nc localhost 5100 < /tmp/ncpipe &
raspivid <etc> | tee /tmp/ncpipe | nc localhost 5000