Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] stdout redirection



On Fri, 2 Mar 2007, Chris BALUTA wrote:

I forgot to add: ./myprog 2> error.log | tee out.file

Though if you want both stderr & stdout to be dumped both
to the screen and to the two files, I can't help you: The above
will dump stdout to the screen and to out.file and it will
dump stderr to error.log. But you won't get stderr on the screen.

You need to set stdout to the appropriate place, and then set stderr to go to the same place as stdout:

    ./myprog 2>&1 | tee out.file

or

    ./myprog >logfile 2>&1


Remember to redirect stdout first, in most cases, this will send stderr to stdout, then stdout to logfile, but leave stderr going to the console:

    ./myprog 2>&1 >logfile

cjs
--
Curt Sampson       <cjs@??>        +81 90 7737 2974


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links