Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Dual redirection

Sep
3
0
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?
 
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
 
or
Code:
>log /a /w protocol.log
>command
 
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!
 
Back
Top
[FOX] Ultimate Translator
Translate