I would like to feed a command with standard input and dump that standard input into the file at the same time. This is just failed attempt:
read | tee dump.txt
this command is waiting for standard input. I expect whatever I input to be fed to read
AND to be dumped into dump.txt. How can I do it?
read
is not really giving you any benefits. Anyway, what about just swapping the pipe around?tee dump.txt | read
– Byte Commander Sep 01 '17 at 22:01lpr
command which is taking raw input from std and printing it. What I need is to tap that communication and dump input into file as well. – Pablo Sep 01 '17 at 22:08read
. Try with e.g.cat
instead, which will read until you close the stream by pressing Ctrl+D (or simply when the piped output ends). – Byte Commander Sep 01 '17 at 22:19read
alone doesn't need double newlines... – Pablo Sep 01 '17 at 22:22