Thread: Pipelining
View Single Post
  #2 (permalink)  
Old 07-18-2005
muthukumar muthukumar is offline
Registered User
 
Join Date: Feb 2005
Location: Coimbatore, Tamilnadu, India
Posts: 119
You have taken correct way. $? will give status of prev command. we can not make it with single utility to give return code and redirect output to another log file. You can do it better as,

# proc > logfile
RC=$?
tee -a <logfile> < logfile
print "$RC"

where, < <filename> is faster than cat <filename>

That is all.
Reply With Quote
Forum Sponsor