bash q

bash q

Amos Shapira amos.shapira at gmail.com
Sat Jun 22 13:48:08 IDT 2013


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.


On 20 June 2013 23:08, Erez D <erez0001 at gmail.com> wrote:

>
>
>
> On Thu, Jun 20, 2013 at 4:01 PM, Erez D <erez0001 at gmail.com> wrote:
>
>> how can i pipe one command to another and get the return value from the
>> first
>>
>> e.g.
>> make | tee log ; x=$?
>>
>> x holds the return value of 'tee'
>> however i want the return value of 'make'
>>
>>
>> any idea ?
>>
>>
>> i should have searched better ...
>
> i found it using $PIPESTATUS[0] ...
>
>
> cheers,
> erez.
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
>


-- 
 [image: View my profile on LinkedIn]
<http://www.linkedin.com/in/gliderflyer>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20130622/44de94dc/attachment.html>


More information about the Linux-il mailing list