Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced output redirection

Status
Not open for further replies.

JeremyS

Programmer
Feb 6, 2001
3
CA
Hey all,

This one has me stumped. What I would like to do is this:

- run a shell script and tee both the stdout and stderr to seperate files so that the screen output looks normal, but each output has its own log file.

Is there anyway that something like this can be done?

Many thanks in advance!
 
This seems to work...
[tt]
( script1 | tee file1 > /dev/tty ) 2>&1 | tee file2 [/tt]
 
Phenomenal, Ygor. I just need to confirm that it works on all systems, but it looks like the answer I was looking for.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top