News for hackers. Stuff that matters.
Re:Pure Bash Bible by Too on Saturday September 21, 2019 @01:51PM (#21036801)
You forgot setting -e and -o pipefail. In case "something" is missing or can't be read for some other reason, your script will just continue happily without warning.

But oh, if you do set -o pipefail the grep will stop the whole pipeline when none of the lines matches "this". So you have to keep fiddling with ${PIPESTATUS[0]}. And none of pipefail or PIPESTATUS are really portable.

Not so simple after all.

There are no comments on this comment yet.