Earlier quoted context omitted.
pipefail do nothing here Isn't that because the syntax provided doesn't use a pipe? Which is why actually using a pipe, rather than paren redirection, is easier on the eyes and the shell. It reads more like the flow of text: maybe_failing() { if ! some-failing-command; then echo "That did not shake out" >&2 return 1 fi } maybe_failing | some-command Is that one of the things StackOverflow said? And if so, why is it n…
This requires that some-command takes input from stdin (many commands don't) and that there's only a single input. What about: process-stuff --file This is the point at which one reaches for tempfiles, usually. The point remains that Edit: Isn't substitution using pipes, though? As in FIFO pipes? You get a file descriptor device which is closed at the end of the script. I don't know if the fd is wired directly to the…
Nope. () is equivalent to creating a named pipe with mkfifo and writing to it:
tmp_pipe_dir="$(mktemp -d)"
mkfifo "$tmp_pipe_dir/pipe"
make-input >"$tmp_pipe_dir/pipe" &
process-stuff --file "$tmp_pipe_dir/pipe"
That's the whole point of it, so that the data can be consumed in parallel with the producer.