Korn Shell - Redireict the stderr and stdout to a file using TEE command

Posted on 2007-08-10
Last Modified: 2013-12-26

Is there a way using TEE command to direct the stderr and the stdou  to a file.  Currently only the stdout is hitting my file with this command and the stderr is hitting the screen:

call Essbase_Bkup.bat | tee F:\EssbaseBackup\Daily\Error_Log.txt

At end of day, I need the Error_Log.txt to contain both



Question by:elwayisgod
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    tee is to duplicate the output.
    you need the 2&>1  to get both into the same file:

    call Essbase_Bkup.bat > F:\EssbaseBackup\Daily\Error_Log.txt 2&>1
    LVL 58

    Accepted Solution

    Try it this way ...

    call Essbase_Bkup.bat 2>&1 | tee F:\EssbaseBackup\Daily\Error_Log.txt

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now