User Tools

Site Tools


bash:output:check_exit_status

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
bash:output:check_exit_status [2021/01/26 14:52] peterbash:output:check_exit_status [2021/01/26 14:58] (current) – [Exit Status from a piped command - using PIPESTATUS] peter
Line 24: Line 24:
 ---- ----
  
-===== Exit Status from a piped command - using PIPESTATUS =====+===== Exit Status from a piped command - use PIPESTATUS =====
  
-What if you want the exit status of one command from a pipeline?  If you want the last command's status, no problem -- it's in $?  just like before.  If you want some other command's status, use the PIPESTATUS array (BASH only.  In the case of Zsh, it's lower-cased pipestatus). +What if you want the exit status of one command from a pipeline? 
 + 
 +If you want the last command's status, no problem -- it's in **$?** just like before. 
 + 
 +If you want some other command's status, use the PIPESTATUS array
 + 
 +<WRAP info> 
 +**NOTE:**  This is BASH only. 
 + 
 +In the case of Zsh, it's lower-cased pipestatus).  
 + 
 +</WRAP>
  
 Say you want the exit status of grep in the following: Say you want the exit status of grep in the following:
bash/output/check_exit_status.1611672754.txt.gz · Last modified: 2021/01/26 14:52 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki