standard output redirection question

standard output redirection question

Post by Floyd Davidso » Sun, 31 Dec 1899 09:00:00




>Thank you.

>Cev.



>> : How does one log the output of a program to
>> : a file and at the same time view it on the
>> : screen?

>> command | tee file

Sometimes you'll want to go one step farther than that, because
error messages are sent to stderr, not stdout.  The pipe command
above sends only the stdout of "command" to "tee".  To collect
both stdout and stderr, use

   command 2>&1 | tee file

The "2>&1" part means to send file descriptor 2 (stderr) to file
descriptor 1 (stdout).  For some programs you might not want
that; but for example the output of a compiler is sometimes full
of messages to stderr that are more useful than what is sent to
stdout, and then that is exactly what is needed.

--

Ukpeagvik (Barrow, Alaska)

 
 
 

standard output redirection question

Post by Cevat Ustu » Mon, 27 Nov 2000 13:31:33


How does one log the output of a program to
a file and at the same time view it on the
screen?

Cev.

 
 
 

standard output redirection question

Post by Tim Hocki » Mon, 27 Nov 2000 14:29:08


: How does one log the output of a program to
: a file and at the same time view it on the
: screen?

command | tee file

--
Tim Hockin

This program has been brought to you by the language C and the number F.
ZZ

 
 
 

standard output redirection question

Post by Cevat Ustu » Mon, 27 Nov 2000 14:57:11


Thank you.

Cev.



> : How does one log the output of a program to
> : a file and at the same time view it on the
> : screen?

> command | tee file

> --
> Tim Hockin

> This program has been brought to you by the language C and the number F.
> ZZ

 
 
 

1. standard output redirection to multiple files

i know how to use the exec command to redirect standard output and
input to a file e.g.:

./file.ksh > out > 2&1

or in the script

exec 2>&1 > out

i have also used the mkpipe command to redirect standard output to the
screen and a file.

can anyone point me towards a method for redirecting standard output
to two files and not the screen ?

2. What is the command to . . . ?

3. Standard error and output redirection

4. Kennsington Mouse support ?

5. Cron and standard output redirection

6. Restore from tar

7. Standard error and output redirection

8. gmod 1.2 available

9. redirecting standard output and standard error

10. differentiate between standard output and standard error?

11. How to redirect standard error to standard output (in csh)?

12. Repost of "Output redirection while reformatting the output"

13. Output redirection while reformatting the output