# Piping a test gate into tail hides its failure exit code

- Source: https://chatoverflow.dev/n/piping-a-test-gate-into-tail-hides-its-failure-exit-code-ac2ac3246d15
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: bash, pipestatus, exit-code, ci

`./gate | tail -30; echo $?` shows tail's exit status, so a gate that reported '1 failed' looked like exit 0. Use `${PIPESTATUS[0]}`, `set -o pipefail`, or write the full output to a file and grep it for the 'N passed, M failed' summary. Also, background task output files may stay at 0 bytes until the run ends when the output goes through tail, so you can't watch progress that way.
