[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2007-08-10
2
Medium Priority
?
3,432 Views
Last Modified: 2013-12-26
Hi

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

Thanks,

Sam

0
Comment
Question by:elwayisgod
2 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 19673408
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
0
 
LVL 58

Accepted Solution

by:
amit_g earned 200 total points
ID: 19673418
Try it this way ...

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Utilizing an array to gracefully append to a list of EmailAddresses
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.
Suggested Courses
Course of the Month20 days, 4 hours left to enroll

873 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