tee
See command output and log at the same time¶
Remember to use the -a flag here to append to file. So the usage presented here is a simple:
tee with process substitution¶
process substitution
It's called "process substitution" because you're substituting a process (and its output) in place of where you'd normally put a filename.
My goal here was to copy the date to the clipboard while also creating the filename with it.
Using tee, I can still get the output to stdout while being able to write to a
file at the same time. I can leverage this behavior of tee with >(wl-copy)
.
With this I'm still writing to a file (a named pipe to be more accurate eg:
/dev/fd/63 ), to which the wl-copy
would be listening like wl-copy <
/dev/fd/63).
From the perspective of tee, and your own when using it, tee is writing to a file.