mirror of
https://github.com/Erreur32/cheat.git
synced 2025-01-03 19:42:17 +01:00
Retrieve N-th piped command exit status
This commit is contained in:
parent
8f0d2e9fc3
commit
b3a93bc128
1 changed files with 4 additions and 0 deletions
|
@ -18,3 +18,7 @@ set -x
|
|||
|
||||
# Turn off debugging:
|
||||
set +x
|
||||
|
||||
# Retrieve N-th piped command exit status
|
||||
printf 'foo' | fgrep 'foo' | sed 's/foo/bar/'
|
||||
echo ${PIPESTATUS[0]} # replace 0 with N
|
||||
|
|
Loading…
Reference in a new issue