Thursday 31 August 2017

windows - How to pipe output and duplicate it to STDOUT?



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/ttynul, naturally, is Windows’ equivalent of /dev/null.)


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...