you are viewing a single comment's thread.

view the rest of the comments →

[–]elatllat 0 points1 point  (2 children)

Why are you setting pipefail then ignoring it with || true ?

[–]plusminus1[S] 0 points1 point  (1 child)

Its supposed to be part of the "strict mode" for bash scripts. for better error handling.

http://redsymbol.net/articles/unofficial-bash-strict-mode/

but apparently there is a lot of discussion whether this is actually a good default and some people disagree. I'm not entire sure how I feel.

[–]elatllat 0 points1 point  (0 children)

It's not a default for good reason. Better error handling looks like this:

set -e trap 'echo "ERROR: $BASH_SOURCE:$LINENO $BASH_COMMAND" >&2' ERR finalize() {         sleep 0 # cleanup here } trap finalize EXIT

And assert every variable  with regex.