pipefail and head
With set -o pipefail, why can yes | head -n 1 (or generate_report | head) make a script fail?
set -o pipefail
yes | head -n 1
generate_report | head
Choose one answer
head always exits with status 1 after printing.
head
The writer gets SIGPIPE once head exits.
SIGPIPE
pipefail doesn't allow more than one pipe per command line in a script.
pipefail
yes never ends, so the script times out.
yes