Remix.run Logo
mananaysiempre 3 days ago

Take care that set -o pipefail will not work on older dash (including IIRC the current Ubuntu LTS), and neither will set -o pipefail || true if set -e is in effect. (For some reason that I’m too lazy to investigate, a failing set invocation will crash the script immediately rather than proceed into the second branch.) The best I could think of to opportunistically enable it was to use a subshell:

  if (set -o pipefail 2>/dev/null); then set -o pipefail; fi
Or you can just target bash, I guess.

(I rather dislike shellcheck because it combines genuine smells with opinions, such as insisting on $(...) instead of `...`. For the same reason, with Python I regularly use pyflakes but can’t stand flake8. But to each their own.)

koolba 3 days ago | parent [-]

> such as insisting on $(...) instead of `...`.

Only one of those can be (sanely) nested. Why would you ever want to use backticks?

oguz-ismail 3 days ago | parent [-]

Looks slick. Works on older shells too