Closed nesv closed 6 months ago
Hmm, it's been like this for a long time, and it was someone other than me (I'm not a native speaker of bash) that brought this in. I'll merge anyways. Startingpoint has the same issue, at least in the modules/README.md
@xynydev I appreciate you taking the time to look at this!
The misplaced -o pipefail
is something I see pretty routinely in scripts. It's not the end of the world, but it does result in dashed expectations when a pipe fails, and the error message doesn't make sense.
Oddly enough, tools like github.com/koalaman/shellcheck don't seem to catch this.
The README for scripts has an incorrect use of the
set
. Where it says to use:it should be:
since
pipefail
is an option consumed byset -o
.More information: https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
I went ahead and did a repo-wide sed(1) call to change all instances of
set -oue pipefail
toset -euo pipefail
.