Hacker News new | past | comments | ask | show | jobs | submit login

Op here. Exactly this. I’ve seen many times where people had scripts and had to modify it (such as commenting code) when something has failed in the middle of the script.



Don't forget about pipefail!!

set -eu set -o pipefail

Anything else I'm missing?


nounset


IIRC, `set -o nounset` is the bash equivalent for `set -u` in sh.


`set -x` can be very useful.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: