How can I pipe the output of one program to another, but also have it appear on screen.
For example, to duplicate what winds up on the clipboard in dir | clip
, or to see what's happening along the way in longer chains.
Answer
If you have a copy of tee
that runs on Windows, such that dir | tee NUL | clip
loads the clipboard, but doesn't display anything on the screen (behaving as you would expect dir | clip
to), try dir | tee con | clip
. (con
is short for “console”; it’s Windows’ equivalent of /dev/tty
. nul
, naturally, is Windows’ equivalent of /dev/null
.)
No comments:
Post a Comment