How about:

    myprog 2>&1 | tee file.txt

I have not tried this but it should work. The "2>&1" redirects stderr to
stdout.

HTH

Hugh

On Thu, 7 Feb 2036, Corisen wrote:

> thanks. but "myprog | tee file.txt" only captures the output from my prog.
> is there any other way to make "tee" captures the error stderr as well? any
> more alternatives other than "tee".
> 
> thank you.
> 
> ----- Original Message -----
> From: rpjday <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 22, 2000 6:13 PM
> Subject: Re: output to screen & file
> 
> 
> > On Thu, 7 Feb 2036, Corisen wrote:
> >
> > > hi, how can i display a program output to screen AND also to file.
> > >
> > > if i use "./myprog 1>>file.txt 2>>file.txt", no output will be shown on
> > > screen. i would like to see the output during runtime and at the same
> time
> > > capture any output & error to a file.
> > >
> > > thanks.
> >
> > $ myprog | tee file.txt
> >
> > the "tee" command redirects standard input to a text file while
> > simultaneously passing it to stdout (in this case, the screen).
> >
> > $ man tee
> >
> > rday
> >
> >
> >
> > _______________________________________________
> > Redhat-list mailing list
> > [EMAIL PROTECTED]
> > https://listman.redhat.com/mailman/listinfo/redhat-list
> 
> 
> 
> _______________________________________________
> Redhat-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to