Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Set pipefail and check $?? Commented Oct 3, 2023 at 3:23
  • A comment about the pipeline you show: pv seems to write to a file via a redirection, meaning sha256sum won't ever get anything to process. Likewise, the output of sha256sum is redirected to a file, so even if it produced output, cut would never get anything to work with. Consequently, the final read won't do anything as all the data is written to files instead of to the next stage of the pipeline. If the redirections are removed, the read might read something into the SHASUM variable, but this is not what our question is about. Commented Oct 3, 2023 at 7:43
  • @Kusalananda - I think this works in zsh when you enable the multios option Commented Oct 3, 2023 at 8:23
  • So it does (sorry for not using my brain). Still, it would be better, for the readability of the question, if the reliance on this feature was either pointed out explicitly or removed in the question. Commented Oct 3, 2023 at 9:14
  • 2
    Your update is a side effect of multios, and it should be asked as a separate question (pv doesn't fail there, so of course there's no failure to detect and so it's a completely different problem than the original question). Commented Oct 3, 2023 at 14:57