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)

link|improve this question
feedback

1 Answer

up vote 4 down vote accepted

tee

call calabash -D sim.xpl 2>&1 | tee test.txt
link|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
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
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
@all sorry I commented before he posted the command just the link. and based on the link description it says multiple files. but yes it works thanks Ignacio! – jtzero Oct 20 '10 at 1:53
show 1 more comment
feedback

Your Answer

 
or
required, but never shown

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