Find the answer to your Linux question:
Results 1 to 6 of 6
I want the o/p of a program to be displayed on the terminal as well as in a file. Tee command does this but, if an error occurs in the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2007
    Posts
    5

    How to create a log File using tee???


    I want the o/p of a program to be displayed on the terminal as well as in a file.
    Tee command does this but, if an error occurs in the program it is only displayed on the terminal and not in the file.How to make tee read from stderr as well or is there any other way to do this.

  2. #2
    Just Joined!
    Join Date
    Apr 2007
    Posts
    18
    Have you tried option " -i " for "tee" command to ignore interrupts ?

  3. #3
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Code:
    command 2>&1 | tee log

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2007
    Posts
    5
    Thanks, the merging of streams did the job.

  6. #5
    ira
    ira is offline
    Just Joined!
    Join Date
    Sep 2010
    Posts
    1
    Are there any possibility to merge stdin to stdout by the same way?
    What I want is to redirest a User interactive process's output to a file, along with the keyboard inputs of the user.

  7. #6
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    Hello, and welcome to the forums, ira!

    Please start a new thread of your own... this thread is over 3 years old.

    Thank you.
    oz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •