commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Tee can be used to split a pipe into multiple streams for one or more process to work it. You can add more " >()" for even more fun.
There is 1 alternative - vote for the best!
the tee command does fine with file names, but not so much with file descriptors, such as &2 (stderr). This uses process redirection to tee to the specified descriptor.
In the sample output, it's being used to tee to stderr, which is connected with the terminal, and to wc -l, which is also outputting to the terminal. The result is the output of bash --version followed by the linecount
If you can do better, submit your command here.
You must be signed in to comment.