Here are some useful and common options you can pass to your script or directly in the shebang.
They are supported by both bash and ksh.
set -e
set -u
set -x
set -o pipefail
You can check with this simple example:
grep something /non/existent/file | sort