4

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)

1 Answer 1

5

tee

call calabash -D sim.xpl 2>&1 | tee test.txt
6
  • 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, 2010 at 20:22
  • @jtzero, did you try? What multiple output files do you see in Ignacio's command line?
    – Arjan
    Oct 19, 2010 at 20:25
  • 1
    tee outputs its input to stdout. Just don't do something silly like redirecting it somewhere else. Oct 19, 2010 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, 2010 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. Oct 20, 2010 at 1:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .