Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a simple call command

call calabash -D sim.xpl >test.txt 2>&1

and this redirects into test.txt, how do I do both redirect into a file and allow it to show up in the prompt?

(I could use the command for both linux and windows)

(use case: tar-ring a backup takes a while and watching the the verbose output allows me to keep an eye on it, and kill it early if needed, rather than to open a large file or wait until its done)

share|improve this question

1 Answer 1

up vote 5 down vote accepted

tee

call calabash -D sim.xpl 2>&1 | tee test.txt
share|improve this answer
    
that just copies to multiple files (learned something new) but is it possible to keep the IO in the prompt and copy it to a file? –  jtzero Oct 19 '10 at 20:22
    
@jtzero, did you try? What multiple output files do you see in Ignacio's command line? –  Arjan Oct 19 '10 at 20:25
1  
tee outputs its input to stdout. Just don't do something silly like redirecting it somewhere else. –  Ignacio Vazquez-Abrams Oct 19 '10 at 20:25
1  
call calabash -D sim.xml 2>&1 >( tee test.txt ) may do what you want. Due to buffering methods you may not see the prompt until you respond to it. –  BillThor Oct 19 '10 at 20:28
1  
Sure, if you pass multiple files to tee then it will copy the output to multiple files. But also to stdout. –  Ignacio Vazquez-Abrams Oct 20 '10 at 1:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.