[Gllug] bash: return status of a command in a pipe?

Benedikt Heinen gllug at ml.icemark.net
Fri Sep 2 12:26:52 UTC 2005


Normally, I'd assume there just has to be a way for this, but - at the 
moment, I'm a bit lost...

How do you get the return value of a command within a pipe?

i.e.  If I run:

 	make 2>&1 | tee make.out

As expected, $? always returns 0 - the result of 'tee'; independently of 
whether make itself terminated successfully or encountered a problem.




Benedikt

   ALLIANCE, n.  In international politics, the union of two thieves who
     have their hands so deeply inserted in each other's pockets that
     they cannot separately plunder a third.
 			(Ambrose Bierce, The Devil's Dictionary)
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list