## first way $output = `command 2>&1`; ## second way open(OLDOUT, ">&STDOUT") or die $!; # backup filehandles open(OLDERR, ">&STDERR") or die $!;
open(STDOUT, ">$tempDir/patchnull.$userName.$machineName.crap.out$$") or die $!; # remap them open(STDERR, ">$tempDir/patchnull.$userName.$machineName.crap.error$$") or die $!; ## do your stuff here #when you are done open(STDOUT, ">&OLDOUT") or die $!; # restore filehandles open(STDERR, ">&OLDERR") or die $!; __END__ I am sure there are other ways too. > -----Original Message----- > From: Hardy, Michael [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 07, 2002 10:24 AM > To: '[EMAIL PROTECTED]' > Subject: Capture of console messages? > > > How can I capture ALL output (STDOUT, STDERR) that's sent to > the console, > and have it placed into a Log file, as well? > Thanks a lot. > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]