<div dir="ltr">If you just want to know if any of the commands failed, you can also set "pipefail", which will set $? to the exit status of the rightmost pipeline command to exit none-zero.</div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 20 June 2013 23:08, Erez D <span dir="ltr"><<a href="mailto:erez0001@gmail.com" target="_blank">erez0001@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><br><div class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote">On Thu, Jun 20, 2013 at 4:01 PM, Erez D <span dir="ltr"><<a href="mailto:erez0001@gmail.com" target="_blank">erez0001@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div>how can i pipe one command to another and get the return value from the first<br>
</div><div><br></div><div>e.g.<br></div></div></div>make | tee log ; x=$?<br><br></div>x holds the return value of 'tee'<br>
</div>however i want the return value of 'make'<br><br><br>any idea ?<br><br><br></div>
</blockquote></div></div></div>i should have searched better ...<br><br></div><div class="gmail_extra">i found it using $PIPESTATUS[0] ...<br><br><br></div><div class="gmail_extra">cheers,<br></div><div class="gmail_extra">
erez.<br>
</div></div>
<br>_______________________________________________<br>
Linux-il mailing list<br>
<a href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br>
<a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">
<a href="http://www.linkedin.com/in/gliderflyer" target="_blank">
<span>
<img src="http://s4.licdn.com/scds/common/u/img/webpromo/btn_viewmy_160x25.png" alt="View my profile on LinkedIn" height="25" width="160">
</span></a></div>
</div>