The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
grep unix.com with google



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #8 (permalink)  
Old 11-25-2009
Registered User
 

Join Date: Nov 2008
Location: Amsterdam
Posts: 1,259
In both ksh and bash:

Code:
set -o pipefail
s1.sh 2>&1 | tee log1.txt  >  log2.txt
echo $?
set +o pipefail

  #9 (permalink)  
Old 11-25-2009
radoulov's Avatar
--
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 3,075
And Z Shell has the multios option:


Code:
% ls a b
ls: cannot access b: No such file or directory
a
% ls a b >file1 >file2 2>&1
% echo $?
2
% head file[12]            
==> file1 <==
ls: cannot access b: No such file or directory
a

==> file2 <==
ls: cannot access b: No such file or directory
a

Sponsored Links
Reply

Bookmarks

Tags
redirect, tee

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 Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to Pull out multiple files from DB table and redirect all those files to a differetn directory? ss3944 Shell Programming and Scripting 3 11-21-2009 02:08 AM
stdout/stdin + flushing buffers JamesGoh High Level Programming 9 10-02-2008 09:15 PM
Wrapper script for image deployment - stdin/stdout - named pipes and the like andreas.ericson Shell Programming and Scripting 2 09-23-2008 04:35 PM
C++ How to use pipe() & fork() with stdin and stdout to another program vvaidyan High Level Programming 2 05-16-2008 08:30 PM
redirect STDIN prkfriryce Shell Programming and Scripting 4 01-04-2007 10:11 AM



All times are GMT -4. The time now is 01:44 PM.


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