Say we have a simple pipeline:
set -eo pipefail;
echo 'foo' | cat
how does cat
know when to exit? Is it when the STDIN stream ends, or does cat
receive a signal? In my case, the producer process receives a SIGINT and then exits with code 1, so how can cat
(consumer process) know which exit code the producer process exited with?