| set -e
| tty defs
| tty chars
| using siginfo
| line charset
Exit status of a pipeline
The behaviour about the exit status of a pipeline in the Bourne shell
changed with System III and with SVR2:
- On Version 7, the status was determined by the first and
the last command in the pipeline.
The last command had precedence, that is, the first command was only
relevant, if the last exited with zero.
|| Exit Status
(exit 0) | (exit 1)
(exit 2) | (exit 1)
(exit 1) | (exit 0)
(exit 2) | (exit 1) | (exit 0)
(exit 3) | (exit 2) | (exit 1)
- With System III, both first and last command were still relevant, but now the first command had precedence.
- On SVR2 and later, the exit status was determined by the last command.
This is the common behaviour nowadays.