The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Move Command and exit status problem visingha UNIX for Dummies Questions & Answers 1 09-12-2008 03:14 AM
Return of EXIT status ( $? ) ZINGARO HP-UX 1 03-12-2008 07:07 AM
Getting the exit status of a remote command zoonalex Shell Programming and Scripting 1 08-23-2006 05:58 PM
how to find the exit status for the last executed command vijay.amirthraj UNIX for Dummies Questions & Answers 1 07-04-2006 11:14 PM
How to find the exit status of last command in Unix? rajugp1 High Level Programming 1 09-10-2002 12:52 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-05-2008
anand_bh anand_bh is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 7
Cool command does not return exit status due to tee

Hi,

I am using /bin/sh. I want to display the stdout and stderr on the terminal as well as save it in a file, so I'm using this command.

gmake all 2>&1 | tee log

But even if gmake fails, it's always giving 0 as exit status, i suppose because of tee.

# false 2>&1 | tee Log
# echo $?
0

I was expecting non-zero value above. Any solution to this problem?

What if I want to use tee as well as get correct exit status?
 

Bookmarks

Tags
exit status, shell script, shell scripting, tee, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0