tee to a file descriptor
tee to a file descriptor
|
|
the tee command does fine with file names, but not so much with file descriptors, such as &2. 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
* View this command to comment, vote or add to favourites * View all commands by camocrazed
commandlinefu.com
by David Winterbottom (codeinthehole.com)
Related Articles:
- 2010/05/10 coproc help - a new feature in bash
- 2010/06/22 cdargs – bash cd command with bookmarks and browser.
- 2010/06/06 colors in bash – script to display all the possible colors.
- 2010/08/02 when you press f9 ‘paste’ is on , press f9 again and ‘paste’ is off, and so forth (works in insert-mode and command-mode)
- 2010/07/16 Upload a video to youtube
Authored By Amit Agarwal
Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.