>>>>> "Larry" == Larry Guest <[EMAIL PROTECTED]> writes:

Larry> I have a small script that does some admin work for me.
Larry> What I need to do now is not only have is display information to STDERR
Larry> and STDOUT but also write the same information I see when I run the
Larry> command to a file.

Larry> I have written it for others who are not very technical.  I want them to
Larry> be able to see the script working and what it is doing.  But I also need
Larry> a log file of the same information so I can have it mailed to me and
Larry> keep a copy on the server.

Larry> I cant seem to get this to work.

I think this might do it:

open TEE, "| tee YourLogFileHere";
open STDOUT, ">&TEE";
open STDERR, ">&TEE";

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to