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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

log file

Status
Not open for further replies.

vlz

IS-IT--Management
Aug 11, 2002
56
IL
Hi,
I'd like to have a log file that
include both stdout and stderr from my script.
But in addition to this log file I also want
to get the script's stdout to the screen.
I wrote this script example:
-------------------------------------------------
#!/bin/ksh
rm mylog
exec 2>>mylog

print "stdout: start log file" |tee -a mylog
print -u2 "stderr: this is error message"
-------------------------------------------------

Is this correct?
Thanks in advance
Vadim
 
Vadim:

In addition to tee to a file you can also tee to the terminal:

someunixcommand 2>> stderr.log|tee /dev/tty ....

Regards,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top