The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
redirecting STDOUT & STDERR jshinaman Shell Programming and Scripting 9 06-21-2007 09:04 PM
precedence of stderr and stdout new2ss Shell Programming and Scripting 1 06-08-2006 08:03 PM
How to use tee with stdout and stderr? siegfried Shell Programming and Scripting 1 11-18-2005 12:07 AM
STDOUT and STDERR going to a system log longyie904 Shell Programming and Scripting 1 09-11-2002 08:42 PM
Redirect stdout and stderr zcurtis Shell Programming and Scripting 8 09-02-2002 03:13 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #8  
Old 11-23-2004
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
As I stated above, the code works bash - do you really need to use the C shell? Could you not encompass the above command inside a bash script?

Cheers
ZB
Reply With Quote
Forum Sponsor
  #9  
Old 11-23-2004
Registered User
 

Join Date: Aug 2004
Location: California
Posts: 14
Yes, I really have to use C Shell. It is official company shell and because of this all my scripts (including this ) are run in C shell.

Thanks,
Reply With Quote
  #10  
Old 11-23-2004
Registered User
 

Join Date: Aug 2004
Location: California
Posts: 14
Folks!
Looks like I found the solution for C Shell. It would be:

command argument |& tee filename.log

Thanks everyone!
Reply With Quote
  #11  
Old 10-12-2007
Registered User
 

Join Date: Apr 2007
Posts: 35
Quote:
Originally Posted by slavam View Post
Folks!
Looks like I found the solution for C Shell. It would be:

command argument |& tee filename.log

Thanks everyone!
Does anyone know an answer for this in ksh?
Reply With Quote
  #12  
Old 10-12-2007
Registered User
 

Join Date: Apr 2007
Posts: 35
Here is what I am trying to do. See how the output of time does not show up in the log.

$ time ls home test 2>&1 | tee -a test.log
ls: 0653-341 The file home does not exist.
test

real 0m0.01s
user 0m0.00s
sys 0m0.02s
$ cat test.log
ls: 0653-341 The file home does not exist.
test
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




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


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0