mirror of https://github.com/cheat/cheat.git
Retrieve N-th piped command exit status
This commit is contained in:
parent
8f0d2e9fc3
commit
b3a93bc128
|
@ -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 New Issue