variable
Bash PIPESTATUS
Array of recent foreground pipeline component statuses. Save immediately in a single assignment.
Formal Syntax & Structure
bash syntaxbash
"${PIPESTATUS[@]}"Return Value
indexed array
Array of recent foreground pipeline component statuses. Save immediately in a single assignment.
Working Example
Example Snippetbash
set +o pipefailfalse | truesaved=( "$?" "${PIPESTATUS[@]}" )printf 'default: %s\n' "${saved[*]}"set -o pipefailfalse | truesaved=( "$?" "${PIPESTATUS[@]}" )printf 'pipefail: %s\n' "${saved[*]}"