LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-12-2007, 01:58 AM   #1
rmvinodh123
LQ Newbie
 
Registered: Apr 2007
Posts: 8

Rep: Reputation: 0
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.

Please help.
 
Old 04-12-2007, 02:21 AM   #2
cfaj
Member
 
Registered: Dec 2003
Location: Toronto, Canada
Distribution: Mint, Mandriva
Posts: 221

Rep: Reputation: 31
Quote:
Originally Posted by rmvinodh123
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.

Redirect the command's stderr to stdout:

Code:
command 2>&1 | tee ....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create log file from script fotoguy Programming 12 03-27-2012 06:39 AM
tee vs > or >> DotHQ Linux - General 3 08-23-2006 01:31 PM
any ideas to reduce log file size or make log file size managed? George2 Programming 2 08-13-2006 06:55 AM
need to create log file sanjay2004 Linux - Newbie 6 02-27-2006 11:11 AM
Script to create a log file satimis Programming 15 01-16-2006 06:39 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration