This is the mail archive of the
cygwin-xfree
mailing list for the Cygwin XFree86 project.
Re: Saving all xterm output to a file
On 2009-02-07, Thomas Dickey wrote:
> On Sat, 7 Feb 2009, teddybouch wrote:
>
> >I am trying to automate a simulation process, and part of this involves
> >capturing the output that is written to an xterm window when a particular
> >process is run. I thought that I had this figured out using the following
> >command:
> >
> >../run 1 Joiner default > results.dat
>
> fwiw, this isn't specific to X...
>
> >"run" is the program that I am running and want to catch the output of. 1,
> >"Joiner," and "default" are parameters needed by that program.
> >"results.dat"
> >is the file that I want the output written to. It was working alright, but
> >then I realized that it wasn't getting all the output that ought to be
> >there. Now, it has progressed to the point that I'm not getting any of the
> >printout statements at all - they don't appear in the xterm window or in
> >the
> >file.
>
> Perhaps you're looking for the messages written to stderr.
> For that you need to redirect stderr as well, e.g.,
>
> ../run 1 Joiner default 2>&1 > results.dat
I think that has to be written this way:
../run 1 Joiner default > results.dat 2>&1
But if you (the OP) wants to see what's going into that file, you
should tee, like this:
../run 1 Joiner default 2>&1 | tee results.dat
HTH,
Gary
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ: http://x.cygwin.com/docs/faq/