Dual redirection

Sep 6, 2011
3
0
#1
I have some long running scripts which display various results along the way. I check on them from time to time so that I can review their progress. However, I also need the results to be redirected to a file so that I can review the full results after the the entire job's completion.

What I'd like to do is have the results echoed to the screen and also redirected to a file. That way I could visually see its progress and then see the full results later.

If I use redirection such as ">>&", nothing is displayed on the screen. I could use TYPE to display the entire contents of the redirection file afterwards, but that wouldn't show me progress along the way.

Is there a way to do both?
 
#2
I have some long running scripts which display various results along the way. I check on them from time to time so that I can review their progress. However, I also need the results to be redirected to a file so that I can review the full results after the the entire job's completion.

What I'd like to do is have the results echoed to the screen and also redirected to a file. That way I could visually see its progress and then see the full results later.

If I use redirection such as ">>&", nothing is displayed on the screen. I could use TYPE to display the entire contents of the redirection file afterwards, but that wouldn't show me progress along the way.

Is there a way to do both?
Use
Code:
 command | TEE /A file
 
Sep 6, 2011
3
0
#4
Vince - I can't believe I forgot about TEE! I was so focused on variations of redirection symbols that I forgot about good-old-fashioned-been-around-forever TEE.

Frank - Thanks to you too! I thought that the LOG command could only record your commands, not their output. Thanks for the tip!