redirecting stdout and stderr in a script

From: Dan O'Callaghan (OcallD_at_cogent-dsn.com)
Date: 07/27/04

  • Next message: André Claude Benin: "Help gcc..."
    Date: Tue, 27 Jul 2004 15:31:07 +0100
    To: <sunmanagers@sunmanagers.org>
    
    

    Hi
    Ive written a script that basically extracts tar files, copies files and
    installs software.

    I want to capture the output of stdout and stderr to a log file as well as
    viewing it on screen.

    Ive worked out that I can use any_command 2>&1 | tee log.file .

    Is there anyway that I can do this once globally for the script or do I have
    to set it at the end of every command?

    Thanks in advance
    Dan.

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.716 / Virus Database: 472 - Release Date: 7/5/2004
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers
    

  • Next message: André Claude Benin: "Help gcc..."

    Relevant Pages

    • Re: Process.BeginErrorReadLine and BeginOutputReadLine; buffer not flushed?
      ... script, and redirects the stdout and stderr output from that script ... That means that if the process gets ahead of your reading process at all, the reading process can still wind up in a thread that's happy to keep reading the stream it's working on, while the OS buffers output sent to the other string. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Process.BeginErrorReadLine and BeginOutputReadLine; buffer not flushed?
      ... script, and redirects the stdout and stderr output from that script ...  But it's not just the StreamReader that does buffering. ...
      (microsoft.public.dotnet.languages.csharp)
    • Open3 with nonblocking reads
      ... I'm currently trying to execute a script within a script, ... single line should contain if it's STDOUT or STDERR, ... STDOuts were passed to the logfile. ...
      (comp.lang.perl.misc)
    • Re: Filter stdout and stderr Together
      ... I would like to write a script that filters lines from both stdout and ... script with the following syntax: ... stderr as expected, but with particular lines filtered out. ...
      (comp.unix.shell)
    • Re: WinNT ActiveState STDERR and STDOUT
      ... the background and capture the output of STDOUT ... and STDERR for later analysis. ... print("Hello World STDOUT from Perl"); ... I tried fudging it to a different log file (before I read this ...
      (comp.lang.perl.misc)