Dup Goto 📝

BashPipeStatus

PT2/aw/os/shell 07-31 13:46:42
To Pop
12 lines, 51 words, 287 chars Monday 2023-07-31 13:46:42

Pipe status

In bash, we use

echo "${PIPESTATUS[@]}"

for an array of exit statuses of processes in a pipe. For example

false | true | false | true | true
echo "${PIPESTATUS[@]}"
# outputs: 1 0 1 0 0

(In ZshSh we use pipestatus (lowercase) instead.)