User Tools

Site Tools


wiki:2018redirect

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
wiki:2018redirect [2018/07/23 10:25]
erin
wiki:2018redirect [2018/07/24 14:14] (current)
erin
Line 61: Line 61:
 $ wc chrI.fa blerg &> wc_both_3.txt $ wc chrI.fa blerg &> wc_both_3.txt
 </​code>​ </​code>​
- 
-/** ===== Branch output to STDOUT and a redirected file with tee ===== 
-* 
-*Sometimes I want my output to go both places... to the screen (stdout) AND to a file. This is really helpful for *monitoring long jobs and saving their output for posterity, too. 
-* 
-*We can use ''​tee''​ to send the information to both a file and STDOUT. This is effectively like putting a T-shaped *pipe in a water-way. A copy of the output will go to both places. 
-* 
-* **__branch output Usage:​__**\\ 
-* **command line** | tee outputfilename.txt 
-* 
-*<code bash> 
-*$ wc chrI.fa blerg | tee wc_both_3.txt 
-*</​code>​ 
-* 
-* 
-*;-) **Quick tip:** To send branch both STDOUT and STDERR to the screen and a file, use \\ 
-* *command** &> tee file.txt 
-* 
-*/ 
  
 :!: **Common pitfall:** redirection will overwrite existing files. If, instead, you would prefer to append the new information to the end of an existing file, you can use ''>>''​ :!: **Common pitfall:** redirection will overwrite existing files. If, instead, you would prefer to append the new information to the end of an existing file, you can use ''>>''​
wiki/2018redirect.txt ยท Last modified: 2018/07/24 14:14 by erin